“JQuery的'未定义 [英] 'JQuery' is undefined
问题描述
我的工作与本地文件系统设置创建一个ASP.net项目。我使用MVC和jQuery。当我运行在调试模式,即在ASP.net开发服务器的应用程序jQuery是工作的罚款。我想在IIS 7.托管应用程序在托管模式下,它不承认jQuery和提供脚本错误'jQuery是未定义'。脚本文件的位置是在两种模式下保持不变。任何人可以有任何线索什么可以的原因以及如何解决这个问题。
I am working on a ASP.net project created with local file system settings. I am using MVC and Jquery. Jquery is working fine when I run the application in debug mode i.e. in ASP.net Development server. I am trying to host the application in IIS 7. In hosted mode, it does not recognize Jquery and gives scripting error 'Jquery is undefined'. The locations of the script files is unchanged in both modes. Can anybody have any clue what can be the reason and how to solve this.
我的code这个样子的;
My code look like this;
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script src="../../Scripts/MicrosoftAjax.debug.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftMvcAjax.debug.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"></script>
<!-- YUI Styles -->
<link href="../../Content/reset.css" rel="stylesheet" type="text/css" />
<link href="../../Content/fonts.css" rel="stylesheet" type="text/css" />
<link href="../../Content/grids.css" rel="stylesheet" type="text/css" />
<!-- /YUI Styles -->
<link href="../../Content/knowledgebase.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
//this hides the javascript warning if javascript is enabled
(function($) {
$(document).ready(function() {
$('#jswarning').hide();
});
})(jQuery);
</script>
<asp:ContentPlaceHolder ID="ScriptContent" runat="server" />
....
推荐答案
尝试使用Firebug的网络标签,查看该文件被加载。
Try using Firebug 'Net' tab to see if the file gets loaded.
您还可以配置Firebug的失败上的所有错误,看看当错误发生时相比,jQuery的获取加载为。
You can also configure Firebug to fail on all errors and see when the error happens as compared to when jQuery gets loaded.
这篇关于“JQuery的'未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!