View Full Version : blocking source code


tdsoma
05-15-2003, 07:00 AM
is it possable to block the sorce code from right click and view menu cus im makin an online shop and i dont want people on the view page looking at the source and not paying?

Lemon Squash
05-15-2003, 10:03 AM
You cant disable it from view - source.. sadly but you can disable the right click.. clicky! (http://www.lissaexplains.com/java6.shtml#noclick)

SSPrincess
05-15-2003, 12:32 PM
Actually I think this might disable the view menu:

<script language="JavaScript1.2">
//original author unknown
//modified by, and displayed on www.a1javascripts.com
if (window.Event)
document.captureEvents(Event.MOUSEUP);

function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;

return false;
}

function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}

}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
document.onmouseup = norightclick;
//-->
</script>

It also disables the right click as well. I hope that this works for you.

amicus
05-15-2003, 12:48 PM
if the user is saavy, they'll just do a 'save as' and look at the source from a text editor or just go into their cache files and look at it there.

once a webpage is served it's on the users machine and there's very little you can do about them viewing the source. if you're building a shopping cart concider putting the business logic on the server side.

tdsoma
05-15-2003, 03:05 PM
lol nm i just denited access to the base file using my ftp so they have to buy it ;)