Click to See Complete Forum and Search --> : List the source code.


Mark Agius
May 28th, 2005, 06:55 PM
On my web site I have disabled the default menu.
Then if I want to display the source code, I run the following code after entering a password.


function DisplaySource(){
// The next line will display the source code (with "view-source:") for this page (this page = window.location.href)
window.location = "view-source:"+window.location.href
}


This works on my old Windows 95 and Windows 98 PC with Microsoft Internet Explorer and Netscape browsers.
But this code doesn't work with my new Windows XP PC.

window.location = "HTML_file.htm" works
so I think the error is in the "view-source:"+window.location.href part.


I would like the code to work with all Microsoft Windows operating systems.
Otherwise code for Windows XP and some code to check which OS is being used would be good.

Mark Agius
May 29th, 2005, 11:05 AM
This code still works with Netscape on my new and old system.
But not with I.E. and Windows XP.