function sethtml(a,b)
{
document.getElementById("canvas_html_"+a).
innerHTML = "<iframe frameBorder="0" scrolling="no" width="200" height="40" name='innerFrame'></iframe>";
var objDoc = window.frames[ "innerFrame" ].document;
objDoc.write(b);
}
這只是將b添加到iframe,頁面變得越來越大。如何替換HTML而不是在JavaScript中追加HTML?
就削減objDoc一部分?併爲iframe設置一個src? –
@ Max0999,'document.getElementById(「canvas_html _」+ a).outerHTML =「...」;'? – ted