Guide to creating a web site, web design, web development, internet marketing, promotion, html tips and tricks, javascript and more.

Your Guide to Professional
Web Site Design and Development

HTML Tips
HTML Codes
Web Development
Web Design Tips
JavaScript Codes
216 Web Safe Colors
CSS Tutorial
JavaScript Tutorial
ASCII Character Codes

Offering Free Javascript Tips, Snippets and Codes

Open Directory Projectfree ebooksfree articles
web site design development internet marketing and promotion tutorials

| Web Site Development | HTML Codes | HTML Tips | Web Design TipsJavascript Snippets | 216 Safe Colors | Symbols | CSS Tutorial | JavaScript Tutorial |

webmaster resources
website design



View source code with a link

(Internet Explorer 6)

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





Submit your JavaScript code snippets. We'll credit you and give you a link to your website.