function sethtml(a,b)
{
var x = document.getElementById("canvas_html").contentDocument; x.write(b);
}
This works but I want to replace the content instead of writing to it.
function sethtml(a,b)
{
var x = document.getElementById("canvas_html").contentDocument; x.write(b);
}
This works but I want to replace the content instead of writing to it.
x.innerHTML = b;
This will replace entirely the contents of x
for ordinary DOM elements. In the case of an iframe, see this question for details on how to clear an iframe. You could then simply use the write
method to add your new content.