0

问题 #1 以下代码在我的母版页中

<html lang="en">
<head id="Head1" runat="server">
    <meta charset="utf-8" />

    <title>Enerteck, industry leading performance catalysts for diesel fuels</title>
    <link href="Styles/Site.css" rel="stylesheet" type="text/css" />
    <link href="Styles/nav.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.8.2.min.js"></script>
    <script src="Scripts/modernizr-2.6.2.js"></script>
    <link href="Content/jquery.lightbox.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery.lightbox.min.js" ></script>
    <asp:ContentPlaceHolder id="HeaderContent" runat="server">
    </asp:ContentPlaceHolder>
</head>

<body>
<form id="form1" runat="server">
     <asp:ScriptManager ID="ScriptManager1" runat="server">
    <Scripts>
        <asp:ScriptReference Name="MsAjaxBundle" />
        <asp:ScriptReference Name="jquery" />
        <asp:ScriptReference Name="jquery.ui.combined" />
        <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
        <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
        <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
        <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
        <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
        <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
        <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
        <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
        <asp:ScriptReference Name="WebFormsBundle" />


    </Scripts>
</asp:ScriptManager>

控制台中的错误是“加载资源失败:服务器响应状态为 404(未找到)blahblahblah/Scripts/jquery-1.8.1.js”

我没有引用 jquery 1.8.1 版本,我显然正在加载 1.8.2,这就是 VS2012 项目中的内容,通过 nuget 包安装。该文件最终位于脚本文件夹中

我的脚本没有运行,我假设这就是原因,因为它们在 jsfiddle 中工作

4

1 回答 1

0

我试图在这里回答一个类似的问题 - https://stackoverflow.com/a/35402418/1945517

这是它的要点,一次采取一步。

1. Print the version that the system is loading like so:
    console.log( "You are running jQuery version: " + $.fn.jquery);
2. View the source of the html page rendered.
3. Look for all the jquery source added, checking at <script> imports.
4. Then look for your source code where this is getting added.
5. Fix that, build, and repeat step 2 until you get the right version.

祝你好运。

于 2016-02-15T06:00:46.570 回答