PDA

View Full Version : Netscape Shutdown


jonathan
08-28-2002, 04:46 PM
Hi,

I was working on a project that's dealing with arrays, creating dropdown menus, and data linking/updateing. My problem is that whenever I try to open the page in Netscape I get a application error and Netscape closes down before the page ever pops up. I tested it on Explorer and it works great. The codeing looks ok, but since Netscape closes I can't figure out what the problem is. If you know any otherway I figure out the problem, please help me. Thanks.

mordred
08-28-2002, 05:03 PM
There are many versions of Netscape floating around. Which one was the troublemaker for you (though I could be it's NN4.x)?

And without knowing whaty your code really does, it's very hard to say. Perhaps you post an URL or a code excerpt that allows for reproducing the errors you encountered.

jonathan
08-29-2002, 08:35 PM
Sorry about the lack of information. Well I deducted what the problem was with my codeing. It deals with having a variable in a switch. I tried all these different ways and none seemed to work. I finally just hard coded it in the end to make it work. The first example case works here and I tried all the others to no success.

switch (fieldtochange.name){
case 'Detailsfield1' : LinkData(arrayvalues, 'DetailsPiecesMF');
break;
case eval(" '"+arg[8]+"' "): LinkData(arrayvalues, 'DetailsLengthMF');
break;
eval("case '"+arg[9]+"': LinkData("+arrayvalues+", '"+DetailsWidthMF+"' "));
break;
case eval("/'"+arg[10]+"/'"): LinkData(arrayvalues, 'DetailsHeightMF');
break;

If you know of a way to put a variable in the case condition, please let me know.

joh6nn
08-29-2002, 08:39 PM
did you try just putting it in? i'm pretty sure that works.

case arg[8]: /* do something */ ; break;

mordred
08-30-2002, 12:21 AM
@joh6nn:
Now that would be too simple, wouldn't it? ;)

@jonathan:
I finally managed to accidentally reproduce your intial problem - my test script killed Netscape. For those interested, it was


function test(val) {
var argl = 'netscape';
switch(val) {
case argl:
alert('ooooops');
break;
}
}

test("netscape");


A note: It crashed Netscape 4.7, and I suppose you also tested a Netscape 4.x version (you forgot that interesting bit of information in your reply ;)). From what I've found in a german newsgroup, the javascript versions employed in NN4.x don't support variables in case statements - NN4.x expects a constant value at compile time.
In Mozilla 1.0 dynamic variables worked ok though.

To conclude, I don't think you can workaround this scenario for NN4.x, also because resorting to repeated calls of eval() can also produce unexpected results ranging from terrible long execution time to immediate shutdown. You'll have to make use of the if / else if statements instead, unless you ditch support for this agonizing browser.

joh6nn
08-30-2002, 12:38 AM
where's the german newsgroup? i'd like to have a look at that article

Quiet Storm
08-30-2002, 01:03 AM
NS Crashers:

http://home.snafu.de/tilman/mozilla/crash3.html
http://home.snafu.de/tilman/mozilla/crash4.html
http://home.snafu.de/tilman/mozilla/crash5.html

Information on NS bugs:
http://css.nu/pointers/bugs-nn.html

mordred
08-30-2002, 01:36 AM
Originally posted by joh6nn
where's the german newsgroup? i'd like to have a look at that article

The newsgroup is de.comp.lang.javascript, and the particular thread I mentioned can be found here (http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&threadm=9rbn40%24ag3%241%40stu1id2.ip.tesion.net&rnum=1&prev=/groups%3Fhl%3Dde%26lr%3D%26ie%3DISO-8859-1%26q%3Dswitch%2Bnetscape%26meta%3Dgroup%253Dde.comp.lang.javascript).