Hi, I'm beginner of js. I'm confused about the usage of "eval" in the
following code. Can we take off it? When shall we use it, when not?
Thanks!
Wendy
-------------------------------------------------
function makeElement(whichEl,whichContainer) {
if (arguments.length==1)
whichContainer = (NS4) ? window : document.body;
if (NS4) {
eval(whichEl + "= new Layer(menuWidth,whichContainer)");
}
else {
elStr = "<DIV ID=" + whichEl + " STYLE='position:absolute'></DIV>";
whichContainer.insertAdjacentHTML("BeforeEnd",elStr);
}
return eval(whichEl);
}