Lesson 7: Viewing the Source Code


So far you have noticed that the buttons we created have interacted with you under certain limitations. Now we will show you a very simple yet powerful interactive feature of JavaScript. The ability to access programs other than the browser.

We will create a button that will open the source code of the current file using notepad. Like this:


[FORM]
[INPUT TYPE=button NAME="view" VALUE="click me for the source of the page " OnClick='window.location="view-source:" +window.location.href']
[/FORM]


Now we can move on to lesson 8.