Page source kept secret!

  Revi 15:52 18 Oct 05
Locked

I thought all webpages show their code up when you press ´page source´ on the menu. Recently I came across a website whose every page appears as a blank notepad screen when ´page source´ is clicked. How is this done?

  Forum Editor 23:13 18 Oct 05

but frankly I wouldn't bother. It's considered a petty-minded thing to do, and in any case it's ludicrously easy to circumvent.

Many people think that html code is copyright-protected, but that's not true - it's the text and images on your site which are protected, the html may be used by anyone.

If you want to do a little experiment, put the following code into the head of your html document, save the page and then try right-clicking on it in your browser. Now got to 'View' on the browser toolbar and select 'source'. See what I mean? This particular script only works in Internet Explorer by the way.

Here's the script:-

<script language="JavaScript">

var message = "Sorry, that function is disabled.\n\n";
message += "This page code is protected, and ";
message += "all content is protected.";

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}

if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

</script>

  Gaz 25 01:34 19 Oct 05

You was fooled.

All the website designer did, was put several returns (spaces) in before the html code begins... try scrolling down.

  Revi 07:48 19 Oct 05

Thanks for your replies. In case you are curious about the site which I came across and hides its code, it is click here.

  Revi 07:54 19 Oct 05

You were right!

  Forum Editor 18:57 19 Oct 05

You can view the source on that site.

This thread is now locked and can not be replied to.

Best phone camera 2016/2017: Galaxy S7 vs iPhone 7 vs Google Pixel vs HTC 10 Evo vs OnePlus 3T vs…

1995-2015: How technology has changed the world in 20 years

The Pantone Colour of the Year 2017 is Green

Super Mario Run preview | Hands-on first impressions of Super Mario Run: Mario's iPhone & iPad…