免費(fèi)學(xué)習(xí)推薦:js視頻教程
javaScript-如何引入js代碼
直接po代碼和截圖
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>js01-如何引入js代碼</title> <script type="text/javascript"> //script標(biāo)簽的type="text/javascript"可以省略 document.write("江西省贛州市于都縣<br/>"); console.log("hello hi n world "); console.log("tom oknjack"); console.log("jerry<br/>ok"); </script> <script src="hello.js" type="text/javascript"></script> </head> <body> <h1>js01-如何引入js代碼</h1> <!-- 如何引入js代碼? 1.直接內(nèi)嵌 2.引入外部的js文件 --> <script type="text/javascript"> //script標(biāo)簽的type="text/javascript"可以省略 document.write("我的老家在江西省贛州市于都縣<br/>"); </script> <script src="hello.js" type="text/javascript"></script> </body> </html>
hello.js文件
document.write("好好工作,努力賺錢(qián)!");
相關(guān)免費(fèi)學(xué)習(xí)推薦:javascript(視頻)