的document.open()方法打开一个新文档,写文档的内容用document.write()方法。然后,document.close()方法用于关闭文件的操作和显示其内容。

例如:
复制代码代码如下所示:

窗口onload =你好;
函数hello(){
javascript很有趣!;
Document.open();
document.write(MSG);
Document.close();
}