window document
生活随笔
收集整理的這篇文章主要介紹了
window document
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1 打開一個新窗口
var newDoc=window.open("text/html","replace");
var txt="<html><body>Learning about the DOM is FUN!</body></html>";
newDoc.document.write(txt);
newDoc.close(); ? //該方法將關閉 open() 方法打開的文檔流,并強制地顯示出所有緩存的輸出內容。如果您使用 write() 方法動態地輸出一個文檔,必須記住當你這么做的時候要調用 close() 方法,以確保所有文檔內容都能顯示。一旦調用了 close(),就不應該再次調用 write(),因為這會隱式地調用 open() 來擦除當前文檔并開始一個新的文檔。
?
2 在文檔里更新
var newDoc=document.open("text/html","replace");
var txt="<html><body>Learning about the DOM is FUN!</body></html>";
newDoc.write(txt);
newDoc.close(); ? //同上
?
轉載于:https://www.cnblogs.com/xjy20170907/p/8474382.html
總結
以上是生活随笔為你收集整理的window document的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《海贼王:FILM RED》剧场版票房破
- 下一篇: 六、利用frp穿透连接内网的linx系统