-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forced into window.jQuery #235
Comments
Can you explain the scenario you have where you load the jsrender.js or jsviews.js and have |
For example with certain Drupal plugins, I have to keep the global jQuery version (which Drupal uses) to a fixed outdated version (ex:1.7). So I load another jQuery (more recent ex: 2.1) which I isolate via jQuery.noConflict(true) into a variable. I then do all my custom stuff inside a anonymous function where jQuery is my new version.
I normally don't have any problem with this pattern because plugins usually use jQuery instead of window.jQuery I hope this is clear. |
Yes, it is clear. I understand how you obtain references to the different versions of jQuery - and I see the need to load jsrender with your myjq version. Just curious though about how you are loading jsrender within the closure:
If you load it as a script file in the browser it will be at global scope - not within your closure. Is this loading on the server? What is the mechanism used to load jsrender.js? Is there some kind of module composition mechanism which allows jsrender.js code to be somehow inserted - concatenated between |
It is inserted via a build workflow with Grunt, so every file I use is concatenated into one file. :) |
So of course you can work around the issue by writing
But I could change jsrender to pass in |
Hey ya, that won't affect the node version AFAIK. Certainly can work around it if something pops up so gets my vote. Thanks for asking :) |
👍 |
@jblandry; @coolbloke1324: There is a fix - to write:
but I am a bit reluctant to add that code. The alternative is for folks who are concatenating files to write a wrapper:
So for the next update (53) at least, I will not make the change stay with Comments? |
Not a problem I'll change my inclusion. Thanks |
OK, sounds good - I'll close this issue. |
I was wondering if there was a reason why the jQuery used is always the window.jQuery instead of the 'local' jQuery? Because I sometimes have to use different jQuery versions on a same site and I can't attach jsrender to the local jQuery.
Thanks
The text was updated successfully, but these errors were encountered: