html當中如何引用js文件


 

3)html當中如何引用js文件

如果需要javascript工程師和html美工各干各的工作,需要分開寫文件。

例 1.2


<html>
<head>
    <script src="Hello.js"></script>
    <title></title>
</head>
<body>
</body>
</html>



Hello.js(如果你用notepad建立一個txt之后你再改為js,一定在存時,要存成utf-8或unicode格式):

    var a ;
    /*before you set value, a' type can not be defined.*/
    document.writeln(typeof(a) + "<br>他們");
    a = true;
    document.writeln(typeof(a) + "<br>");
    /*下面的console.log只有安裝了firebug的firebox不報錯*/
    console.log("This is the 1 message 馬克-to-win write in %s", a);
    document.writeln(a);

文章轉載自原文:https://blog.csdn.net/qq_44594249/article/details/98882787


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM