|
-
November 26th, 2004, 04:37 AM
#1
Disable View Source
Is there any way to hide users from seeing the source code?
Madhivanan
-
November 27th, 2004, 09:12 AM
#2
Re: Disable View Source
yes- at least you can make it harder to see:
serach for a function to "disable" right click (indeed it is a function that on
right click show an alert...), and have your pages without menubar, title bar,...
(serach for "window.open" and its options...)
Then you should disable also the possibility of opening a new window from
previous (see what happens when in Ie you press ctrl+n ?)
example of disabling right click
Code:
<script language=JavaScript>
<!--
var message="Function Disabled!";
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
// -->
</script>
Code:
example of opening windows
window.open ("http://www.Codeguru.com","mywindow","status=1");
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
November 29th, 2004, 12:00 AM
#3
Re: Disable View Source
Thanks. I want to know how to disable tool bar.
Madhivanan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|