HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Running newer version of jquery (1.9+ compatability layer).
Don't run a different version of jquery unless you absolutely have to.
There was a step change i njquery between after 1.9, and the jquery team decided not to provide backwards compatibility for some things.
However they provided a compatibility script.
https://github.com/jquery/jquery-migrate/
grab copy of this
http://code.jquery.com/jquery-migrate-1.2.1.min.js
put it a file say jquery_capability.js
You need a fix for UI so append this to the file.
//jQuery UI fix $.curCSS = function (element, attrib, val) { $(element).css(attrib, val); };
Make sure this script is loaded immediately after jquery.
grep is your friend.
Tagged:
2
Comments
What about using jQuery.noConflict()
https://api.jquery.com/jQuery.noConflict/
I thought that helped with the loading libraries of different versions ...
I do know that running multiple versions can break things like cleditor and emotify.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Not related. This is to do with old method of jquery not being in 1.9.
jquery decided to remove a lot of the bloat, rather then carry every depreciated method. So they can streamline jquery.
noConflict is to do with other js libraries that use $ in the global scope.
You should never use
$
in the global scope anyway, it bad style.generally speaking jquery should be self contained.
You should not really need noConflict these days. Unless $ is deliberately exposed.
grep is your friend.
Btw never load two version of jquery, it really bad practice, and silly.
grep is your friend.
here is an example of how to load these files using themehooks, assume you create a file called
class.customthemehooks.php
You probably want to use a more unique name for you class name and file name.
grep is your friend.
Finally someone normal I was using noConflict when I was trying to get Bootstrap working with Prototype (becouse of MyBB is using prototype still...). And I totally agree that using 2 diff jQuery versions at once is totally stupid, it is like you will have on PC IE 8 and IE 9, on one running Facebook and on other one Twitter and switching between them with ALT-TAB. And no, I am not IE lover, it is just worst example that came to my mind . Nice tut for newbies.
@x00 thank you so much for your posts here. You saved be an incredible amount of time.