How do I handle having two separate jQuery libraries? I need both of them, but including both results in a conflict, and only one’s functions will work.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends. You can actually have both of them active in the page at the same time, but only one of them can have the
$symbol, and only one of them can have thejQuerysymbol. But technically, you can have more than one on a page:Note that a well-authored jQuery plug-in will work even in that environment, e.g.:
…because a well-authored plug-in looks like this:
…and so will use whatever is
jQueryat the point you include it, without breaking if you later fire offnoConflict(true).Is it a good idea? Almost certainly not. Best to resolve whatever the issues are that make you need more than one version of jQuery, and only include the latest you’ve tested with.