Has anyone used Dojo and jQuery in the same project?

Has anyone used Dojo and jQuery in the same project? I need the object-oriented part of Dojo (and nothing more) and JQuery to simplify the presentation, but I'm afraid of collisions and collisions of names. Can I use both pages on the same page?

+7
source share
3 answers

use jQuery.noConflict(); before writing a jQuery code block

Additional Information:

http://api.jquery.com/jQuery.noConflict/

read also this article:

http://www.sitepen.com/blog/2010/11/15/from-jquery-to-large-applications/

+9
source

Yes, it is possible, and I am doing it right now. I use Dojo for my structure and JQuery for presentation. It works without problems, and there should be no conflict. Read the second article mentioned by diEcho.

+4
source

Simply put, this will work. However, if you are using Dojo AMD, you may get problems here.

It turns out that jQuery gets confused if it sees the 'define.amd' on the JS variable on the page. And this is not the AMD that it knows about or is configured to use, especially if it's Dojo AMD, because this bootloader has baseUrl, where Dojo is located on the server , not where jQuery is located.

Therefore, the suggestion is to avoid using Dojo AMD when using jQuery and Dojo on the same page. Note that handlebarsJS is implemented on the same issue.

+1
source

All Articles