"document函數 open(),write(),writeln(),close()"
主控台測試
document.open();
document.write('content');
document.close();
將目前的顯示的網頁,覆蓋,內容為content。
document.open();
document.write('content');
document.writeln('content');
document.write('content<br>');
document.write('content<br>');
document.close();
writeln() 只是對應一般文字檔的換行,並不在網頁中換行,而是被視為一個空白。真的換行必須寫標籤<br>
。
|
|
產生網路傳輸錯誤。因為<img>
標籤,會產生HTTP request GET
。