[thelist] javaScript not Netscape Compliant

Simon Perry thelist at si-designs.co.uk
Thu Apr 15 14:43:56 CDT 2004

Casey Crookston wrote:

>I know, I know... Here comes Netcrap again.
>The script is to auto-force the same page to re-load when the user selects
>from a drop down menu...
><snip />
>Here is the online version:
>What needs to change to make it work with Netscape?

Your chosen function name "goto" is a reserved identifier [0] plus your 
code is a little sloppy. The following should work nicely. I have 
corrected the script definition, renamed the function, added a semicolon 
at the end of the first var declaration and corrected dodument.location 
(sic). If IE was working with the original code then hats off to it but 
you can hardly blame Netscape ;-)


[0] http://dotnet.di.unipi.it/EcmaSpec/PartitionV/cont4.html or
(p26 -14-)

<script type="text/javascript" language="JavaScript">
function swapTo(form) {
         var index=form.select.selectedIndex;
         if (form.select.options[index].value != "0") {

<form name="form1"><select name="select" onchange=
"swapTo(this.form)" size="1">

More information about the thelist mailing list