0x800a1391 - JavaScript 运行时错误:“$”未定义:直接链接有效但解决方案资源管理器文件无效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21849342/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
0x800a1391 - JavaScript runtime error: '$' is undefined: directlink works but solution explorer file doesn't
提问by Hannes
I got this error because VS can't find the jquery file. I have added it in solution explorer and added the source in my master page's head but VS can't find it for some unknown reason. I tried json2 and it doesn't work either. Finally I tried to use the directlink to jquery downloadpage and it worked and the problem was solved.
我收到此错误是因为 VS 找不到 jquery 文件。我已将它添加到解决方案资源管理器中,并在我的母版页的头部添加了源代码,但 VS 由于某些未知原因找不到它。我试过 json2 也不管用。最后,我尝试使用 jquery 下载页面的直接链接,它起作用了,问题解决了。
But, this isn't a clean fix since it will not work if the jquerysite stops working so I want a better fix do this problem. Do you have any tips?
但是,这不是一个干净的修复,因为如果 jquerysite 停止工作,它将无法工作,所以我想要一个更好的修复来解决这个问题。你有什么建议吗?
This is the easy fix:
这是简单的修复:
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
回答by Systematix Infotech
I think this is a jquery conflict error , please put this "jquery-1.9.1.min.js" file top of the all jquery files.
我认为这是一个 jquery 冲突错误,请将这个“jquery-1.9.1.min.js”文件放在所有 jquery 文件的顶部。
回答by Madara Uchiha
check your scripts folder
检查您的脚本文件夹
if you are using the same version of jquery as i am, you can add this line to your layout, if your page is indeed using a layout
如果您使用的 jquery 版本与我相同,则可以将此行添加到您的布局中,如果您的页面确实使用了布局
<script src="~/Scripts/jquery-1.10.2.min.js"></script>