加载错误版本的jQuery [英] Wrong version of JQuery being loaded

查看:279
本文介绍了加载错误版本的jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开辟了一个老Asp.Net应用程序我工作和更新的NuGet包。当我尝试运行这个程序,我得到了以下错误:

I recently opened up an old Asp.Net application I was working on and updated the Nuget packages. When I try to run this app I get the following errors:

的http://本地主机:7055 /脚本/ jQuery的-1.8.2。 min.js 的无法加载
  资源:服务器回应的状态404(未找到)
  的http://本地主机:7055 /脚本/ jquery.signalR-1.0.0.js 无法加载
  资源:服务器回应的状态404(未找到)`

http://localhost:7055/Scripts/jquery-1.8.2.min.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:7055/Scripts/jquery.signalR-1.0.0.js Failed to load resource: the server responded with a status of 404 (Not Found)`

以上是采取从Chrome的控制台选项卡。

The above was taken from the Chrome console tab.

下面是我的页面的源代码显示在Chrome:

Here is what my page source shows in Chrome:

<!--Script references. -->
<!--Reference the jQuery library. -->
<script src="/Scripts/jquery-1.8.2.min.js" ></script>
<!--Reference the SignalR library. -->
<script src="/Scripts/jquery.signalR-1.0.0.js"></script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="/signalr/hubs"></script>

不过,这不是我的实际源引用的版本。这里是我的实际来源:

However, that is NOT the versions I am referencing in the actual source. Here is my actual source:

<!--Script references. -->
<!--Reference the jQuery library. -->
<script src="/Scripts/jquery-2.1.4.min.js" ></script>
<!--Reference the SignalR library. -->
<script src="/Scripts/jquery.signalR-2.2.0.min.js"></script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="/signalr/hubs"></script>

下面是我packages.config的内容:

Here is the contents of my packages.config:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="jQuery" version="2.1.4" targetFramework="net45" />
  <package id="Knockout.Mapping" version="2.4.0" targetFramework="net45" />
  <package id="knockoutjs" version="3.3.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.SignalR" version="2.2.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.SignalR.Core" version="2.2.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.SignalR.JS" version="2.2.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.SignalR.SystemWeb" version="2.2.0" targetFramework="net45" />
  <package id="Microsoft.Owin" version="3.0.1" targetFramework="net45" />
  <package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net45" />
  <package id="Microsoft.Owin.Hosting" version="3.0.1" targetFramework="net45" />
  <package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" />
  <package id="Mongodb" version="1.7.1.4791" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
  <package id="Owin" version="1.0" targetFramework="net45" />
</packages>

我曾尝试清洗,停止所有IIS防爆preSS的网站,删除从C临时文件:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\临时ASP.NET文件\\ ROOT \\和重建,仍然问题仍然存在。

I have tried cleaning, stopping all IIS Express sites, deleting the temp files from C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ and rebuilding and still the problem persists.

这是哪里拉从这个古老的参考?我没有其他脚本引用在我的code。

Where is it pulling this old reference from? I have no other script references in my code.

由于提前,

格雷格。

推荐答案

我有同样的问题,这是我的固定它。

I had the same problem and this is how I fixed it.

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.

祝你好运。

这篇关于加载错误版本的jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆