jQuery:noConflict [英] jQuery: noConflict

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

问题描述

我无法解决这个问题。我的上帝让我的大脑受伤了,所以我转向你,互联网上的好人。

I just cannot work this out. My god it's making my brain hurt, so I turn to you, the good people of the internet.

我一直盯着 jQuery $。noConflict()函数的文档没有运气。

I've been staring at the documentation for the jQuery $.noConflict() function with no luck.

我的问题是我正在开发的网站已经包含了jQuery 1.1.3.1,但我想在一些地方做一些非常棒的时髦UI工作,所以我想要使用1.4.2是显而易见的原因。

My issue is that the site I'm working on already includes jQuery 1.1.3.1 but I want to do some awesome and snazzy UI work in a few places, so I want to use 1.4.2 for obvious reasons.

我一直试图并排运行这些但我似乎无法获得任何代码来执行。我还需要使用1.4.2实现一些插件,所以我不确定是否可以将jQuery放到类似 $ j 的东西上,因为显然插件会有用 $ jQuery as 1.1.3.1 而不是 1.4.2

I've been trying to run these side by side but I can't seem to get any code to execute. I also need to implement a few plugins using 1.4.2 so I'm not sure if putting jQuery over to something like $j would work, as obviously the plugins would pick up $ and jQuery as 1.1.3.1 rather than 1.4.2.

有没有办法可以将我的代码包装在 noConflict中( )阻止并且还包括我需要创建一个 1.4.2 代码的自包含块的插件?

Is there a way that I can wrap my code in a noConflict() block and also include the plugins that I need to create a self contained block of 1.4.2 code?

任何帮助都会很棒,因为我的贫穷思想在广阔的荒地中消失,这是API文档!

Any help would be fantastic as my poor mind weeps amid the vast wasteland that is the API docs!

推荐答案

你应该简单地将整个站点升级到1.4.2。

jQuery通常不会有很多重大变化,所以这不应该那么难。

You should simply upgrade the entire site to 1.4.2.
jQuery does not in general have many breaking changes, so that shouldn't be so hard.

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

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