JavaScript View Source Script

 

This script will show you the HTML source code of a page by the click of a button.

(Does not work in IE)

 

Example

 

 

 

Script Source

 

<The Form >

<FORM>
<INPUT TYPE="button" value="Try it! Click Here" onClick="getcode()">
</FORM>

 

<The JavaScript >

<script type="text/javascript">
function getcode()
{
var thecode= "view-source:" + window.location;
window.location= thecode;
}
</script>

Please let me know if this script was helpful to you.

[rating]