Using an anchor tag with its associated HREF parameter, you can cause a
hyperlink to display the source of a Web page when the hyperlink is
clicked. To do so, set the value of the HREF parameter equal to "view-
source:someFile.htm" where someFile.htm is the name of an HTML file that
you want to show using the default editor for HTML source code.
Being able to display the source code of a Web page is valuable to those
Internet Content Providers (ICPs) that wish to demonstrate how their pages
have been created.
Please note that "view-source" works only on absolute links. Also, if you
are trying to access an HTML file through the FILE protocol, you must fully
qualify the URL like this:
Some Link
The following HTML code demonstrates how to show the source code for
http://www.microsoft.com/ie40.htm when the hyperlink is pressed.
<HTML>
<HEAD>
<TITLE>Show microsoft.com source code</TITLE>
</HEAD>
<BODY>
<A HREF="view-source:http://www.microsoft.com/ie40.htm">
Show microsoft.com/ie40.htm source code
</A>
</BODY>
</HTML>
NOTE: When you use this protocol a copy of the file is written to the temp directory.