View webpage source using javascript
If you wanna see your webpage source using javascript 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
Related posts:
- Displaying Text from User On Your Webpage
- Password protect pages using javascript
- Add to favorites or bookmarking using javascript in firefox and internet explore [IE]
- Words Validation with Javascript
- Disabling right click menu using javascript Enhanced Version
- PHP is not executed and source visible
- How to close a child window from a parent window using javascript







