引用外部JavaScript文件不能执行,嵌入HTML中却可以执行,console报错Cannot set property onmouseover'of null

一、将js放在body的最后

二、js文件中有其他的错误,导致无法加载到所需脚本

这种情况可以通过将需要的脚本独立到一个文件当中解决,也可以通过debug将其余错误找出来解决

猜你喜欢

转载自blog.csdn.net/ArthurCaoMH/article/details/88366852