你犯了“功能”的拼写错误。你错误地写了“功能”。纠正它。
function copyRight () { var lastModDate = document.lastModified var lastModDate = lastModDate.substring(0,10) displayCopyRight.innerHTML = "<h6>The URL of this document is" + document.URL + "<br />Copyright Smart Homes System<br />This document was last modified " + lastModDate + ".</h6>" }
您只定义了函数,从不调用它们。您需要调用函数来执行它们。
我也建议移动你的整个 script 在...之前下来 /body 标签。
script
/body
所以,像这样:
<div id="displayCopyRight"> </div> <script> // your other JS code goes here... countDown(); scrollColor(); loadInfo(); copyRight(); </script> </body> </html>