美文网首页
快速实现js编程

快速实现js编程

作者: 简明教程计划 | 来源:发表于2017-10-27 23:01 被阅读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文件中书写我们想要实现的程式。

相关文章

网友评论

      本文标题:快速实现js编程

      本文链接:https://www.haomeiwen.com/subject/jaxjpxtx.html