js的三种引用方式? 小浣熊的姐姐小还熊 2019-01-03 302 阅读1分钟 浏览器导入JS的三种方式 行内导入JS (慎用 不安全) <div onclick="alert('hello world')">点我</div> 内嵌式 <script> // 内嵌式 alert("hello world"); </script> 外联式 <script src="./day.js"></script> 内嵌导入和外链导入不能混合一起使用,如果当前是外链导入的,那么在script脚本块中编写的所有代码都不会执行。