[xul-interop] setting innerHTML-property problem

Erik Winter <[email protected]> Thu, 25 Aug 2005 13:29:07 +0200
Newsgroups gmane.comp.lang.xul.general
Message-ID <[email protected]>
Hello all,

I have a xul-document with a html-document embedded in an iframe and 
I want to set the content of a <div> in the html-document.

If I try:

document.getElementById("idOfFrame").contentDocument.getElementById("IdOfElement").innerHTML 
= '<b>Some html..</b>';

nothing happens, but if I try:

setTimeout("document.getElementById('idOfFrame').contentDocument.getElementById('idOfElement').innerHTML 
= '<b>Some html..</b>';", 0);

I get what I want.

I can show the original contents of the <div> by displaying the 
.innerHTML with an alert() before both methods, so I have verified 
that I'm targetting the right element. Can anyone explain why the 
first method isn't working? I've also tried to fill the <div> by 
using the DOMParser, without the timeout, but that didn't work either.

This is all in Mozilla 1.7.11 in Windows, by the way

Thanks,

Erik

-- 
http://www.efocus.nl




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
XUL News Wire      - http://xulnews.com
XUL Job Postings   - http://xuljobs.com
Open XUL Alliance - http://xulalliance.org