dorinp
Jun 28th 2008, 9:40 am
Hi,
Have you deal with this 'eval' function issue ?
In the JS code below - option a) work well but the b) is not working.
Have you any idea why? It's this a JS bug ?
I need this for having a line like: eval('document.all.counter_' + param1 + '.innerHTML') = 123;
Thanks,
Dorin
//--------JS script----------
function test()
{
html_code = '<div id="mydiv"></div>';
document.write(html_code);
// -- a)
document.all.mydiv.innerHTML = 123;
// -- b)
eval('document.all.mydiv.innerHTML') = 123;
}
Have you deal with this 'eval' function issue ?
In the JS code below - option a) work well but the b) is not working.
Have you any idea why? It's this a JS bug ?
I need this for having a line like: eval('document.all.counter_' + param1 + '.innerHTML') = 123;
Thanks,
Dorin
//--------JS script----------
function test()
{
html_code = '<div id="mydiv"></div>';
document.write(html_code);
// -- a)
document.all.mydiv.innerHTML = 123;
// -- b)
eval('document.all.mydiv.innerHTML') = 123;
}