2

我的 JavaScript 程序中有以下代码行

MyFrame.src = mainPath + "/resources/help.htm";

这是默认设置,但在某些情况下,我想使用我动态构建的字符串加载此 iFrame 的内容,例如:

"<html><head></head><body>This is additional help that was built dynamically on the fly</body></html>"

有没有办法做到这一点?

谢谢

4

1 回答 1

6

是的:

MyFrame.contentWindow.document.write("<html><head></head><body>This is additional help that was built dynamically on the fly</body></html>");
于 2012-09-14T21:16:22.413 回答