I need my script below (it's within a CGI program) to work in Netscape Navigator, and for some reason the javascript doesn't work - I click on one of the icons on the left ("Inbox", "Box2" or "Trash"
, and it does nothing, whereas in IE the function "GoTo" is called and an alert box is shown (followed by submission of the form).
Someone suggested putting <!-- and --> round my javascript code, but this caused it not to work in either IE or NN!
The code is below. Thanks for any help.
print "<html>";
print "<head><title> Webmail table </title>";
print "<SCRIPT LANGUAGE='JavaScript'>";
#print "<!--";
print "var temp = 'inbox';";
print "var temp2 = 'box2';";
print "var temp3 = 'trash';";
print "function goto(to)";
print "{ alert('get there'); document.mailform.box.value = to; document.mailform.submit(); }";
print "function del()";
print "{ document.mailform.delmove.value = 'del'; document.mailform.submit(); }";
#print " -->";
print "</script>";
print "</head>";
print "<body>";
print "<form name='mailform' action='/~cs91aj/mail.cgi' method='Post'>";
print "<input type='hidden' name='name' value='yes'>";
print "<input type='hidden' name='pass' value='yes'>";
print "<input type='hidden' name='box' value='$box'>";
print "<input type='hidden' name='delmove' value='none'>";
print "<table border=0><tr><td valign='top'>";
print "<table border=0>";
print "<tr><td><a href='javascript:goto(temp);'>Inbox</a></td></tr>";
print "<tr><td><a href='javascript:goto(temp2);'>Box2</a></td></tr>";
print "<tr><td><a href='javascript:goto(temp3);'>Trash</a></td></tr>";
print "</table></td><td>";
Someone suggested putting <!-- and --> round my javascript code, but this caused it not to work in either IE or NN!
The code is below. Thanks for any help.
print "<html>";
print "<head><title> Webmail table </title>";
print "<SCRIPT LANGUAGE='JavaScript'>";
#print "<!--";
print "var temp = 'inbox';";
print "var temp2 = 'box2';";
print "var temp3 = 'trash';";
print "function goto(to)";
print "{ alert('get there'); document.mailform.box.value = to; document.mailform.submit(); }";
print "function del()";
print "{ document.mailform.delmove.value = 'del'; document.mailform.submit(); }";
#print " -->";
print "</script>";
print "</head>";
print "<body>";
print "<form name='mailform' action='/~cs91aj/mail.cgi' method='Post'>";
print "<input type='hidden' name='name' value='yes'>";
print "<input type='hidden' name='pass' value='yes'>";
print "<input type='hidden' name='box' value='$box'>";
print "<input type='hidden' name='delmove' value='none'>";
print "<table border=0><tr><td valign='top'>";
print "<table border=0>";
print "<tr><td><a href='javascript:goto(temp);'>Inbox</a></td></tr>";
print "<tr><td><a href='javascript:goto(temp2);'>Box2</a></td></tr>";
print "<tr><td><a href='javascript:goto(temp3);'>Trash</a></td></tr>";
print "</table></td><td>";