引用两种不同版本的JQuery

编程入门 行业动态 更新时间:2024-10-16 22:20:41
本文介绍了引用两种不同版本的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

本文发布于:2023-11-30 16:05:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1650625.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:两种   版本   JQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!