Jump to content

[SOLVED] disabling view source on pages


bladechob

Recommended Posts

Use javascript onClick event handler to disable the right click

 

There are plenty on the internet

 

<script language=JavaScript>

<!--

 

//this example is from www.dynamicdrive.com

 

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>

 

Hope this helps

 

Steve (Blackpool)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.