
Can someone tell me why this eval() doesn't work in IE
Is there some reason why you're not just doing this:
paramArray[0] = "item=html";
eval(paramArray[0]);
which seems to be exactly the same without the complicated middle steps?
BTW, following your original direction you should try using:
eval(name+"="+value);
or
window[name]=value;
since variables are just properties of the window.
Additionally, I would avoid using either "name" or "value" as variable names.
Tim.
Quote:
> paramArray[0] = "item=html"
> name = paramArray[0].substring(0, paramArray[0].indexOf("="));
> value = paramArray[0].substring(paramArray[0].indexOf("=")+1);
> eval(name+"=value");
> // alert(item) should show "html" but nothing happens in IE
> // however, it does in NS. Please help.
> // - Matt