我已经在我的jquery脚本中添加了defer属性来提高网页性能,但是现在我得到了错误$ is not defined。当页面加载时,我需要执行JS代码,所以我使用jQuery.ready事件,但当使用defer时,它不起作用。<head>
<script defer="defer" src="@Url.Content("~/Scripts/jquery-1.
我得到了错误:Uncaught ReferenceError: $ is not defined at index.html:76。我查看了以前的一些解决方案,其中建议将<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>包括在<head>中。但是,当我这样做时,将弹出另一个错误:
Refused to execute scrip