JavaScript學習筆記(六) ─ 在HTML中引入JS

HTML當中

<!DOCTYPE HTML>
<html>

<body>

<p>script 标签之前...</p>

<script>
alert('Hello, world!');
</script>

<p>...script 标签之后</p>

</body>

</html>

外部引入

<script src="/path/to/script.js"></script> #資料夾中<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.2.0/lodash.js"></script>  #CDN中<script src="/js/script1.js"></script>  #多個腳本
<script src="/js/script2.js"></script>

Written by

Machine Learning / Deep Learning / Python / Flutter cakeresume.com/yanwei-liu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store