This Tutorial Has Been Viewed 1,735 Times.
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![]()
You will also be interested in ,
- Dynamically Changing hyperlink color on a website using javascript
- Add to favorites or bookmarking using javascript in firefox and internet explore [IE]
- Simple javascript calculator with basic arithmetic operations
- Add a mouse cursor or pointer trailing text using javascript
- Block key press using javascript
- Jquery Basics, How to use jquery?
- Visitor counter using cookies and javascript
- Calendar Script Using Javascript [Updated]
- Write data to a page using javascript
- Check whether the browser is Internet Explorer or not using javascript
Categories: JavaScripts