you wish! Llamasery Co-operative Web Forum

More about how to protect your source.

Click on the View button, then choose Source. What appears seems to be blank [varies depending on your browser - so it's not a very good 'protection' method] actually it isn't blank, it's a normal html file with lots of white space added at the top. But, it still isn't the source code for this page. That's because this page of the demonstration uses frames .. and view source displays the frameset html not the page html. So, remember frames as one method for 'protecting' your source code. In combination with the 'no right clicks' scripts it takes protection a step further.

And here is the 'no right clicks' script.

You can stop right clicks with a script (copy and paste it from this page if you want to) in the HEAD section of your page.

<script type="text/javascript">

var msg="mouse right click disabled.\n\n(or any message you want)";

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(msg);
return false;
}
}

if (document.layers) {
if (e.which == 3) {
alert(msg);
return false;
}
}
}

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

</script>

And you could use frames as well to prevent the code on your page being viewable when the toolbar View button is used.

And if you really want to keep your images 'safe', use a graphics editor to add your site URL to them. Why would someone want to re-use an image on their site that obviously came from somewhere else?

I don't want frames and/or I don't understand frames!!

Well, if you don't understand frames this is as far as it's worth going. Take that script and add it to your pages.

But if you want to go deeper into the realms of javascript so that the toolbar disappears ... choose the next page. Are you sure your code and images are really worth it?

... so, the last question is ...

What can I do to make it a bit more difficult??

PREVIOUS  |  NEXT


Copyright ©1999-2003 - halfadot smallwebs: all rights reserved.

Help Site main page Home Contact Us