快速实现js编程
2017-10-27 本文已影响0人
简明教程计划
通常我们都把JavaScript代码放到<head>中:
<html>
<head>
<script>
alert('Hello, world');
</script>
</head>
<body>
...
</body>
</html>
在HTML中通过<script src="..."></script>引入js这个文件:
<html>
<head>
<script src="/static/js/abc.js"></script>
</head>
<body>
...
</body>
</html>
文件引入后我们只需要在js文件中书写我们想要实现的程式。