View source code of web page using Javascript
View source code of web page using Javascript
If you want to View source code of web page using Javascript then here is a simple example just copy and paste the script below to your webpage and press the View Source button.
<form action="#" onsubmit="return getsource();"> <input type="submit" value="View Source!" /> </form> <script type="text/javascript" > function getsource() { var thesource= "view-source:" + window.location; window.open(thesource, 'source_code', 'width=400, height=400, resizable=1, scrollbars=1'); return false; }</script>
This script will work on Mozilla and Chrome. IE hate this script :PView source code of web page using Javascript,