Click to See Complete Forum and Search --> : right click alert Netscape


tripwater
06-27-2003, 09:13 AM
Hello I have some code that pops an alert on right click when a viewer tries to view source. It works fine in IE how would I get it to work in a Netscape/Mozilla platform?

code:

<script language="javascript">
function rclick() {
var mydate=new Date()
var myyear=mydate.getFullYear()
if (event.button==2) {alert('Hello World.')}
}
document.onmousedown=rclick
</SCRIPT>

I am learning and experimenting at this point so any help would be greatly appreciated. Thanks

Asch
06-27-2003, 09:29 AM
that should work with NS....


function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}


cheers

asch
:D