次のjavascriptスクリプトでは問題はありますか? document.writeln
はdocument.write
、または他の方法で置き換えてください。私はwrite()
とwriteln()
の間には大きな違いはありませんhttp://www.wetlandpark.gov.hk/en/document.writelnを使用する必要がありますか?
function getheaderHTML() \t {
document.writeln(' <div id="nav">');
document.writeln(' <a href="index.html">number 1</a>|<a href="students.html">number 2</a>');
document.writeln(' </div>');
document.writeln(' <div id="header">');
document.writeln(' <img src="header.jpg" alt="testing" width=100% height=260>');
document.writeln(' </div>');
}
function getfooterHTML() \t {
document.writeln(' <div id="footer">');
document.writeln(' ©2016');
document.writeln(' </div>');
}
getheaderHTML();
getfooterHTML();
、Rajshekarレディにあなたのコードをリファクタリングします。 – Sen
'document.write'と' document.writeln'を使ってページにデータを追加するのは悪い方法です。 –
なぜあなたはそれをネイティブHTMLとして書くことができませんか?なぜスクリプトが必要なのですか? –