Link to home
Start Free TrialLog in
Avatar of netformx
netformx

asked on

eval in Netscape does not work properly

I have the following code:
var VendorId123Array = ....
...
var vendorId  = 123;
var selectedArray = eval("VendorId" + vendorId + "Array");

in Netscape selectedArray is null, why?
In IE  - works OK
Avatar of Arijit S
Arijit S
Flag of India image

Ok..if u break this up in two lines, does this work? E.g.
---------------------------------------------------------------
var selectedArrayStr="VendorId"+vendorId+"Array";
var selectedArray=eval(selectedArrayStr);
---------------------------------------------------------------

And...what version of Netscape are u using?

Regards
WC
Avatar of netformx
netformx

ASKER

I should support Netscape 7.1, 7.2, 8, Firefox
Hmnn...ur code works fine in FF 1.0.5.

I will check the issue with NN.

Regards
WC

PS: But...did that 2 line idea work?
no it didn't
Could you try the whole thing?

 eval("var selectedArray = VendorId" + vendorId + "Array");
ASKER CERTIFIED SOLUTION
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Works is  Netscape 8.0.3.3