0

VS 2010,C#,MVC 3,jQuery 1.8.1.8。项目在另一台开发人员机器上编译良好,我正在尝试设置我的工作。

在运行时,我收到一条错误消息“Microsoft JScript 运行时错误:'jQuery' 未定义”

它在 jQuery UI Widget 函数 1.8.18 上失败:

*/(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;if(b[d]>0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))})(jQuery);/*!

使用 NuGet 升级没有任何作用,而且我可以升级到的内容受到限制,因为其他开发人员无法升级。

我已经将我的解决方案与其他开发人员的解决方案进行了比较,它们看起来都一样。他也没有使用任何 NuGet。

有人有任何提示吗?

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <title>@ViewBag.Title | Compliance</title>
    <link rel="shortcut icon" href="favicon.png" /> 

    <script type="text/javascript">
        left_width = 163;
    </script>

    @Html.CssFile("common.css")
    @Html.CssFile("MedResearchPrint.css", true, "print")  
    @Html.CssFile("style.css", false) 
    @Html.CssFile("sorting/dataTable.css") 
    @Html.CssFile("menus/single_seventeen.css")
    @Html.CssFile("galleriffic-5.css")

    @Html.CssFile("jquery.autocomplete.css")
    @Html.CssFile("fancybox/jquery.fancybox-1.3.0.css")
    <link href="@GlobalVariables.ResourceDomain/javascript/msgbox/jquery.msgbox.css"     rel="stylesheet" type="text/css" />

    @Html.CssFile("jqueryui/jquery-ui-1.7.2.custom.css")
    <link href="@GlobalVariables.ResourceDomain/javascript/windows/dhtmlxwindows.css" rel="stylesheet" type="text/css" />
    <link href="@GlobalVariables.ResourceDomain/javascript/windows/skins/dhtmlxwindows_dhx_skyblue.css" rel="stylesheet" type="text/css" />

    @Html.ScriptFile("jquery-1.5.1.min.js")   
    @Html.ScriptFile("form/jquery.form.js")  
    @Html.ScriptFile("jquery-ui-1.8.18.custom.min.js", false)
    @Html.ScriptFile("fancybox/jquery.fancybox-1.3.0.pack.js")
    @Html.ScriptFile("MedResearch.js")    
    @Html.ScriptFile("menu.js")     
    @Html.ScriptFile("effects.core.js")     
    @Html.ScriptFile("jquery.corners.js")     
    @Html.ScriptFile("jquery.cookie.js")     
    @Html.ScriptFile("effects.slide.js")    


    @Html.ScriptFile("sorting/jquery.dataTables.min.js") 
    @Html.ScriptFile("shortcut/shortcut.js")

    @Html.ScriptFile("jquery.galleriffic.js") 
    @Html.ScriptFile("jquery.opacityrollover.js")
    <script src="@GlobalVariables.ResourceDomain/javascript/msgbox/jquery.msgbox.min.js" type="text/javascript"></script>

    @Html.ScriptFile("hash/hash.js")
    @Html.ScriptFile("time/jquery.ui.timepicker.js", false)
    @Html.ScriptFile("numeric/jquery.numeric.pack.js", false)

    <script src="@GlobalVariables.ResourceDomain/javascript/windows/dhtmlxcommon.js" type="text/javascript"></script>
    <script src="@GlobalVariables.ResourceDomain/javascript/windows/dhtmlxwindows.js" type="text/javascript"></script>
    <script src="@GlobalVariables.ResourceDomain/javascript/windows/dhtmlxcontainer.js" type="text/javascript"></script>

    <!--<script type="text/javascript" src="@Url.Content("~/")content/js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="@Url.Content("~/")content/js/jquery-ui1.8.18.custom.min.js"></script>
    <script type="text/javascript" src="@GlobalVariables.ResourceDomain/javascript/windows/lib.js"></script>-->
    <script type="text/javascript">root = "@Url.Content("~/")";</script>
    <script src="@GlobalVariables.ResourceDomain/javascript/windows/lib.js" type="text/javascript"></script>
    @Html.ScriptFile("common.js", false) 
    @RenderSection("Head", false)

    <!--[if lt IE 8]>
    @Html.CssFile("MedResearchIE.css")
    @Html.CssFile("IE7Fixes.css", false)

    <script type="text/javascript">
        $(document).ready(function() {
            if($(".header .filter").val() != null)
                $(".header").addClass("left");
        });
    </script>
    <![endif]-->


</head>
<body class="thrColLiqHdr" onload="fixHeight();">
    <div id="vp_container">
    <a id="top"></a>
    <div id="container0">
        <div id="container">
            <div id="masthead" style="background-image: url('@ViewBag.ImageFile');">
                <div id="siteName">
                    <img src="@GlobalVariables.ResourceDomain/images/iresearch.png" alt="iResearch" />
                </div>

                <div id="icons">
                    <a href="javascript:void(0);" id="toggle_lpanel" class="menu_collapse_left" title="Hide Left Panel">&nbsp;&nbsp;&nbsp;&nbsp;</a>&nbsp;&nbsp;
                    <a href="javascript:void(0);" id="toggle_rpanel" class="menu_collapse_right" title="Hide Right Panel">&nbsp;&nbsp;&nbsp;&nbsp;</a>&nbsp;&nbsp; 
                    <a href="javascript:void(0);" id="toggle_bpanels" class="hide_both" title="Hide Both Panels">&nbsp;&nbsp;&nbsp;&nbsp;</a>&nbsp;&nbsp; 
                    <a href="javascript:void(0);" onclick="javascript:print();" title="Print">
                        <img src="@GlobalVariables.ResourceDomain/images/silkIcons/printer.png" alt="print" />
                    </a>&nbsp;&nbsp;
                </div>
                <div id="about_img">
                    <a href="#" id="image_src" data-number="@ViewBag.ImageNumber" title="Learn more about this image">@ViewBag.ImageDesc</a>
                </div>

            <div id="globalNav">
                <div id="globalNav_item1" class="globalNav_item">
                    <a href="http://gradstudies.med.miami.edu" class="glink">Graduate Studies<br />
                    </a>
                    </div>
                    <div id="globalNav_item2" class="globalNav_item">
                    <a href="https://research.miami.edu" class="glink">Research Reporting</a>
                    </div>
                    <div id="globalNav_item3" class="globalNav_item_current">
                        <a href="javascript:void(0);" class="glink">Compliance</a>
                    </div>
                </div>
                <div id="utility">
                    @if(GlobalVariables.User != null) 
                    {
                        <text><a href="@Url.Action("logoutcas", "account")" id="sign_out" title="Sign Out">Sign Out</a> |     <span id="active_username">@GlobalVariables.User.ToString()</span> <span id="record_role"></span></text>

                        <input type="hidden" id="user_role" value="@GlobalVariables.User.Role.Code" />
                    }
                </div>
                <div id="globalNav_b">
                </div>
                <!-- end #header -->
            </div>

            @if (IsSectionDefined("Left"))
            {
                @RenderSection("Left", false)
            }
            else
            {
                if (ViewBag.MenuGroups != null)
                {
                    <div id="colleft">
                        <div id="panel">
                            @if (GlobalVariables.User != null)
                         {
                                <div id="sidebar1">
                                    <ul id="main-nav">
                                        @foreach (var item in ((List<UMiami.Core.MenuGroup>)ViewBag.MenuGroups).OrderBy(p => p.OrderNumber))
                                        {
                                            <li><a class="nav-top-item @(item.IsSelected ? " current" : "")"  href="@(item.LinkUrl != null ? item.LinkUrl : "#")">@item.Name</a>
                                                @if (item.WebPages.Count > 0)
                                                {
                                                    <ul>
                                                        @foreach (var page in item.WebPages.OrderBy(p => p.OrderNumber))
                                                        {
                                                            <li><a title="@page.Description" href="@page.LinkUrl" class="@(page.IsSelected ? "current" : "")">@page.Name</a></li>
                                                        }
                                                    </ul>
                                                }
                                            </li>
                                        }
                                        @RenderSection("AdditionalMenuItems", false)

                                    </ul>
                                </div>
                         }
                        </div>
                    </div>
                }
            }

           <div class="wrapper">
            @if (IsSectionDefined("Right"))
            {
                <div id="colright">
                    <div id="panelright">
                        <div id="sidebar2">
                            <div class="content">
                                @RenderSection("Right")
                                <div class="cleaner margin">&nbsp;</div>
                            </div>
                        </div>
                    </div>
                 </div>
            }


                <div id="mainContent" class="mainContent">
                    @RenderBody()

                    <div id="loading" style="display: none;"><img alt="loading..." src="@Url.Content("~/content/img/ajax-loading.gif")" /></div>
                    <form action="/" id="excel_form" method="post"></form>

                    <iframe id="hidden-iframe" style="display:none;"></iframe>
                 </div>

                <div class="cleaner">&nbsp;</div>

                <div id="footer">
                    <p>
                    Sponsored.
                    </p>
                    <div id="anchor">
                       <a href="#" title="Return to Top">
                            <img src="@GlobalVariables.ResourceDomain/images/return_btns.gif" alt="top" /></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
</body>
</html>
4

1 回答 1

0

您尚未在 Layout.cshtml 文件中注册 jQuery 或 jQuery UI。您必须先添加对 jQuery 库的引用,然后再添加对 jQuery UI 库的引用。像这儿

<script type="text/javascript" src="/jquery.min.js"></script>
<script type="text/javascript" src="/jquery.ui.min.js"></script>
<script type="text/javascript" src="@GlobalVariables.ResourceDomain/javascript/windows/lib.js"></script>
于 2013-05-07T18:40:37.813 回答