What is jquary no conflict?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Soumalya DasRank #2,515 · 558 reputationPosted Aug 7, 2016, 8:25 PM EDT
Many JavaScript libraries use
$as a function or variable name, just as jQuery does. In jQuery's case,$is just an alias forjQuery, so all functionality is available without using$. If you need to use another JavaScript library alongside jQuery, return control of$back to the other library with a call to$.noConflict(). Old references of$are saved during jQuery initialization;noConflict()simply restores them.If for some reason two versions of jQuery are loaded (which is not recommended), calling
$.noConflict( true )from the second version will return the globally scoped jQuery variables to those of the first version.script src="other_lib.js">script> script src="jquery.js">script> script> $.noConflict(); // Code that uses other library's $ can follow here. script>