Ticket #7049 (closed feature: fixed)
making jQuery.noConflict() callable anytime
| Reported by: | jclain | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.6 |
| Component: | core | Version: | 1.4.2 |
| Keywords: | noConflict | Cc: | |
| Blocking: | Blocked by: |
Description
hello,
I use jQuery in an environnement where other js library than jquery are loaded, and the loading order of libraries may be difficult to control properly. I use a code like this in all my pages (this is autogenerated):
jQuery.noConflict()(function ($) { ... });
I understand that jQuery.noConflict() should only be callled if jquery is loaded *after* the other library. I would like noConflict() to be callable anytime. I attach a patch that return control of $ and jQuery only if really necessary
This patch work for me. But if there are any defiencies in this code that can't see, please let me know
with best regards, jephte clain
Attachments
Change History
Changed 3 years ago by jclain
-
attachment
jquery.js.patch
added
comment:1 follow-up: ↓ 2 Changed 3 years ago by snover
- Priority set to low
- Status changed from new to open
- Milestone 1.4.3 deleted
The best way to get patches into core is to submit them as pull requests on GitHub.
comment:2 in reply to: ↑ 1 Changed 3 years ago by jclain
Replying to snover:
The best way to get patches into core is to submit them as pull requests on GitHub.
hello, I submitted a pull-request.
regards, jephte clain
comment:3 Changed 3 years ago by snover
3rd party pull request
comment:4 follow-up: ↓ 5 Changed 3 years ago by rwaldron
snover, this patch does not conform to the current source style. The if statement must have opening and closing curly braces.
comment:5 in reply to: ↑ 4 ; follow-up: ↓ 6 Changed 3 years ago by jclain
Replying to rwaldron:
snover, this patch does not conform to the current source style. The if statement must have opening and closing curly braces.
hello,
should I submit another pull request, or will you fix the patch? thanks in advance
comment:6 in reply to: ↑ 5 ; follow-up: ↓ 7 Changed 3 years ago by jclain
Replying to jclain:
Replying to rwaldron:
snover, this patch does not conform to the current source style. The if statement must have opening and closing curly braces.
should I submit another pull request, or will you fix the patch? thanks in advance
I modified the code to respect current source style. it seems to have automatically merged with the pull request on github regards, jephte clain
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

this patch is against the nightly build as of sept 18, 2010