<!--VIEW SOURCE KEY TRIGGER--> <!-- This goes in the HEAD of the html file --> <script language="JavaScript" type="text/javascript"> <!-- Copyright 2003, Sandeep Gangadharan --> <!-- For more free scripts go to http://sivamdesign.com/scripts/ --> <!-- var key = "v"; // change the key on the left to suit your needs. Numbers can also be used. function theSource(e) { if (document.layers) { var thisKey = e.which; } else { thisKey = event.keyCode; } if ((String.fromCharCode(thisKey).toLowerCase() == key)) { location.href="view-source:"+location.href } } document.onkeypress = theSource; //--> </script> <!-- In the example it is the 'v' key that has been set to trigger the function that opens the source code. -->