Use own $ variable, make sure Jquery can be loaded#228
Use own $ variable, make sure Jquery can be loaded#228Sebobo merged 1 commit intogermanysbestkeptsecret:masterfrom
Conversation
|
I have same issue using the library with Drupal. Drupal use jQuery with noConflict mode to avoid conflicting use of the As changed by this PR, it is a common practice to use immediately-invoked function expression to protect Hope this PR is accepted. |
|
Hey, thanks for the PR! What do you guys think? |
|
Immediate-invoked function expression binds the In that sense, immediate-invoked function is much more friendly to jQuery users when they need to use multiple jQuery versions together. They simply have to arrange the script call order properly like this: ...
<script src="js/jquery-3.1.1.js" />
<script src="js/Wookmark.js" />
<script src="js/jquery-1.17.1.min.js" />
<script src="js/some-old-plugin.js" />
...So as long as Wookmark is depending on jQuery, I think adopting the pattern is a better idea than replacing all |
|
@yookoala true, I never do that, but I know there are websites which need it. |
If use $ variable directly, Wookmark may be cannot call Jquery function (Such as running on Drupal).