hotkristaleice
06-30-2003, 03:01 PM
Hi. I've noticed around certain people's pages, that viewing their source comes out blank, so that people can't copy their html codes. Or they put a "dummy" file up with fake codes. I was wondering how I could do that, to stop people from viewing my source?
you can do a search in the forum for such things, but as discussed each time... there is always a way to still view the source code anyways.
there is absolutely no way to hide or disable the source code. there is always a way around anything you try.
the blank page thing is just a bunch of return spaces before the real coding.
the jibberish thing is a type of encoding, but is easily de-coded.
frames point to the files locations.
non-right click are able to be disabled.
and so forth and so on...
designhazard
06-30-2003, 11:00 PM
but you can still encrypte the file. you can also add a password into it.
amicus
07-01-2003, 12:38 AM
i think you mean encode :) (doesn't matter, i know what you mean.). any encoding you do the browser still has to be able to decode it. the decoding would be done on the users machine not the server and that's where the problem is. once the page is on the users machine there isn't much anybody can do.
SSPrincess
07-01-2003, 01:26 AM
Well, there is a code that stops people with older computers from viewing the source....sadly, it doesn't work on some of the newer computers, but it's better than nothing:
<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>
Hope this works for you!
bane_vagabond
07-01-2003, 02:36 AM
hmmm... I wish you could block them from looking at your source, but I haven't seen anything that blocks, the View>Source at the top of the menu....
Don't forgot, there is another way for them to view your code, File, Save As, and there you go. Put that script on and they only have a 2/3's chance......
I wish I could help...