If you're
looking for a simple way to enable your visitors to view your source code,
this JavaScript code is for you. By adding this simple little JavaScript
code to your web site, you can create a link that, when clicked on, will
open your source code.
This script is useful for sites that are teaching any type of web design
coding and need an easy way for their visitors to view their source
code.
View
Source
Place this code between your <HEAD> and </HEAD>
tags.
<script
language=JavaScript>
<!-- Script courtesy of http://www.web-source.net - Your Guide to Professional
Web Site Design and Development
function ViewSource() {
window.location = "view-source:" + window.location.href }
// -->
</script> |
Place this code
where you would like your link to appear.
<a
href=javascript:ViewSource()>View Source</a> |
Script code provided by:
Philip Walls
Copyright 2001 Philip Walls
Under the terms of the GNU General Public License |
|