开发者

conflict between jquery-1.2.6.min.js and jquery-1.4.2

Hi all i put jquery file in master page version jquery-1.4.2.min.js and in another 开发者_StackOverflowpage jquery file jquery-1.2.6.min.js just in Firefox the jquery features don't work


JavaScript doesn't support class, function or whatever library.

You're just including jQuery twice - different versions -.

If you want to use both, you'd need to change jQuery prefix.

Version A: $ Version B : $$

Or any other valid prefix.

You can do so by changing jQuery object name to jQueryA and jQueryB, and at the end of jQuery source code, change the "$":

// Expose jQuery to the global object
window.jQueryA = window.$ = jQueryA;

...and:

// Expose jQuery to the global object
window.jQueryB = window.$$ = jQueryB;

It's not a good approach so far, but maybe your requirements are leaving an old version of jQuery for some tasks because you don't support some code, and you want to do some new feature with another and newer jQuery version...


What happens when you include jquery a second time, is that it forgets all customizations that has been made since the first include. So the solution is simple: Dont include it twice.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜