Hello Jan,

This works for me, only for recent trunk builds:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";>
<description>
<div id="HtmlResult" xmlns="http://www.w3.org/1999/xhtml"/>
</description>
<script>
<![CDATA[
var innerHTML = "<b>Test</b>";
var result = document.getElementById("HtmlResult");
result.innerHTML = innerHTML;
]]>
</script>
</window>


If you want to make it work in older versions, you should follow the other suggestions that have been made.

Regards,
Martijn

Jan Odvarko wrote:
Hi All,
how can I dynamically inject an HTML into an existing XUL page by JavaScript?


I have tried following but it doesn't work:

<description>
        <html:div id="HtmlResult"/>
</description>

var innerHTML = "<b>Test</b>";
var result = document.getElementById("HtmlResult");
result.innerHTML = innerHTML;

Thanks for any help!

Honza




_______________________________________________
mozilla-layout mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-layout

Reply via email to