[thelist] DOM + IE elements creation problem

Misha Genkin misha.genkin at gmail.com
Mon Nov 7 13:19:15 CST 2005


Hi.
I am having a little problem with getting some JS/DOM script to work.
It works just fine when using Firefox 1.0.6, but renders nothing but a few
blank lines when using IE 6.0 or IE 7.0 Beta.
 
for (i = 0; i < wysiwygEditor.menuRes.emoticons.length - 3; i ++)
{
xAnchor = document.createElement("a");
            xAnchor.href = "#";
            xAnchor.onclick = menuEventHandler;
            xEl = document.createElement("img");
            aTemp = wysiwygEditor.menuRes.emoticons[i].split(";;");
            xEl.id = "insertImage;" + aTemp[i] + ";" + nID
            xEl.src = wysiwygEditor.menuRes.emoticons.baseURL + aTemp[0] +
wysiwygEditor.menuRes.emoticons.fileType;
            if (aTemp[1].indexOf("xClass") == -1)
            {
                        aCSS = aTemp[1].split(";");
                        for (i = 0; i < aCSS.length; i++)
                                    xEl.style[aCSS[i].substring(0,
aCSS[i].indexOf(":"))] = aCSS[i].substr(aCSS[i].indexOf(":") + 1);
            }
            else xEl.className = aTemp[1].substr(7);
                                    
            xEl.alt = aTemp[2];
            xAnchor.appendChild(xEl);
            document.getElementById("real" + sType +
nID).appendChild(xAnchor);
}
 
All the variables have the right values, and defined elsewhere in the code
before that part. Once again the code is fully functional when using Firefox
1.0.6.
Does anybody have any idea what may be the problem with this code?
 
Thanks in advance
Misha.



More information about the thelist mailing list