Hi Hugh, Am 20.03.2008 um 21:13 schrieb Hugh Gibson: >> I can't >> test it right now (I'm currently updating my Windows virtual >> machine), but maybe you have to use this: >> >> imgElement.setAttribute("id", theId) >> >> instead of this: >> >> imgElement.id = theId > > I use the setAttribute form. > > Logging the text before and after transformation gives this in IE: > > 011547 DEBUG: abling.fragment.handlers.CMessage[1343]: <p><img > width="335" > height="227" src="../../../user/data/_a030100000%5EU_f%40_000.png" > alt=""/></p><p><img width="300" height="203" > src="../../../user/data/_a030100000%5EU_f%40_001.png" > alt=""/></p>011579 > > DEBUG: abling.fragment.handlers.CMessage[1343]: <P><IMG > id=ablingpreload0 > height=28 alt="" src="../../../images/sys/loader.gif" width=28></P> > <P> > <IMG id=ablingpreload1 height=28 alt="" > src="../../../images/sys/loader.gif" width=28></P> > > Which is rather strange - why aren't there quotes around the id?
Welcome to the wonderful world of IE :-) When you read the innerHTML property, IE serializes the DOM inside the element in a "canonical" way. Yes, it can make you cry, but just look the other way and pretend you didn't see anything, OK? ;-) Anyway, the missing quotes are no problem. Whatever IE spits out for innerHTML can be fed back the same way. I performed some tests, and code like this works just fine for me in IE: var test = document.createElement("div"); test.innerHTML = "<span><img src='x' /></span>"; test.getElementsByTagName("img")[0].setAttribute("id", "idtest"); var test2 = document.createElement("div"); document.body.appendChild(test2); test2.innerHTML = test.innerHTML; alert(document.getElementById("idtest").src); It doesn't matter whether I first set the innerHTML of test2 or append it to the document. IE (7) always outputs the correct src attribute. Maybe you're doing something special (like using iframes) that complicates things? Regards, Andreas ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel