-
[HELP]JavaScript
Hi,
Can someone please help me with the javascript it doesnt work in firefox it is still able to be right clicked it works in ie but now on ff please help me.im javascript noob :P.
Thanks.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>DarkGaming</title>
</head>
<body>
<body bgcolor="#000000">
<embed src="music.mp3" autostart="true" hidden="true" loop="true">
<font color="FF0000">
<script language="JavaScript">
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
return false;
alert("Dont even try it");
alert("Mwhahaha");
return false;
**
return true;
**
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
</script>
<marquee id="alertit" style="position:absolute;left:0px;top:0;background-color:#000000" onMouseover="this.scrollAmount=1" onMouseout="this.scrollAmount=speed"></marquee>
<script type="text/javascript">
var themsg='<span style="font:italic 22px Arial;color:red;"><b>Please Log In'
var speed=6 //speed of scroller (1-10 or more)
var loops=2 //specify number of times message scrolls across screen (an integer or "infinite")
function populatescroller(){
var windowwidth=iecompattest().clientWidth
document.getElementById("alertit").innerHTML=themsg
document.getElementById("alertit").style.width=windowwidth
document.getElementById("alertit").scrollAmount=speed
document.getElementById("alertit").scrollDelay=20
document.getElementById("alertit").loop=loops
document.getElementById("alertit").onfinish=function(){
document.getElementById("alertit").style.visibility="hidden"
**
**
function iecompattest(){
return (document.compatMode!="BackCompat")? document.documentElement : document.body
**
if (document.all && document.getElementById){
window.onload=populatescroller
window.onresize=populatescroller
**
</script>
<script language="javascript">
<!--//
/*This Script allows people to enter by using a form that asks for a
UserID and Password*/
function pasuser(form) {
if (form.id.value=="xxxx") {
if (form.pass.value=="xxxx") {
location="page2.html"
** else {
alert("Invalid Password")
**
** else { alert("Invalid UserID")
**
**
//-->
</script>
<center>
<table bgcolor="black" cellpadding="12" border="1">
<tr><td colspan="2"><center><h1><i><b><font color="FF0000">Login
Area</b></i></h1></center></td></tr>
<tr><td><h1><i><b><font color="FF0000">UserID:</b></i></h1></td><td><form name="login"><input
name="id" type="text"></td></tr>
<tr><td><h1><i><b><font color="FF0000">Password:</b></i></h1></td><td><input name="pass"
type="password"></td></tr>
<tr><td><center><input type="button" value="Login"
onClick="pasuser(this.form)"></center></td>
</body>
</html>
-
Don't you notice the
Code:
else if (navigator.appName == 'Microsoft Internet Explorer' &&
as well as the Netscape one?
-
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&