/    Sign up×
Community /Pin to ProfileBookmark

right click alert Netscape

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

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@AschJun 27.2003 — 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

?
×

Success!

Help @tripwater spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...