开发者

backing out of jQuery.noConflict? $ and jQuery used together?

开发者 https://www.devze.com 2023-03-16 04:57 出处:网络
I\'ve been converting a large website (>10K files) that used several different JS libraries to just standardize on jQuery. I\'ve been using jQuery.noConflict (with the jQuery object instead of $).

I've been converting a large website (>10K files) that used several different JS libraries to just standardize on jQuery. I've been using jQuery.noConflict (with the jQuery object instead of $).

Now that I'm finished standardizing, I would like to convert back to the standard jQuery syntax ($), instead of the jQuery keyword. However, it seems that I cannot use both $ and jQuery simultaneously. Either $ or jQuery works (depending on noConflict), but not BOTH at the SAME TIME? I was hoping to go page by page, reverting to standard syntax, taking my own sweet time, and not having to do a massive search/replace all at once. Any ideas?

CLARIFICATION: My problem is with jQuery UI tabs not working correctl开发者_如何学Pythony. Maybe other parts of jQuery work fine with ($ and jQuery, side-by-side), but tabs definately DOES NOT.


Did you try removing the noConflict altogether?

jQuery's standard behaviour without it is that both $ and jQuery work.

However I suspect that if any of your files invoke noConflict it'll affect every file. A simple work around may be to simply specify:

window.$ = window.jQuery

in one of your files.

0

精彩评论

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