引用两种不同版本的JQuery [英] Reference two different versions of JQuery

查看:257
本文介绍了引用两种不同版本的JQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好,所以我有两个用于MVC 4网站之一的JQuery插件

Ok, so I have two JQuery plugins that I use for one of my MVC 4 sites

  • jQuery验证
  • JQGrid

JQuery Validation插件依赖于JQuery版本1.9,而JQGrid插件依赖于JQuery 1.7.

The JQuery Validation plugin is dependent of JQuery version 1.9 while the JQGrid plugin is dependent on JQuery 1.7.

这两个插件都在同一视图中使用.如何包含两个版本?

Both these plugins are used in the same view. How do I include both versions?

我阅读了有关Jquery noconflict函数的信息,但是由于我没有直接引用特定的JQuery版本,因此这并不适用.我还尝试使用似乎无效的JQuery迁移插件.

I read about the Jquery noconflict function, but because I'm not referencing a specific JQuery version directly this does not apply. I also tried to use the JQuery migrate plugin which didn't seem to work.

关于如何解决此问题的其他想法?

Any other ideas on how I can resolve this?

推荐答案

您不需要引用jQuery的两个不同版本,因为jqGrid与1.9兼容.

You don't need to reference two different versions of jQuery, as jqGrid works with 1.9.

来源:其网站上的演示示例使用jQ1.9,并且从他们的 wiki 引用:

Source: the demo examples on their website use jQ1.9, and also a quote from their wiki:

要求: jQuery库,版本1.3或更高版本.

Requirements: jQuery library, version 1.3 or later.

如果您使用的jqGrid版本低于4.4.4,则可能需要对其进行升级.与运行两个版本的jQuery相比,这将是一个更简单的过程.

If you are using an older version of jqGrid than 4.4.4, you may need to upgrade it. This will be a simpler process than running two versions of jQuery.

这篇关于引用两种不同版本的JQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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