Has anybody used Dojo and JQuery in the same project?

前端 未结 3 611
清酒与你
清酒与你 2021-01-02 17:33

Has anybody used Dojo and JQuery in the same project? I need a Dojo object oriented part ( and nothing more ) and JQuery for easier presentation, but I am afraid of collisio

相关标签:
3条回答
  • 2021-01-02 18:24

    In simple terms, this will work. However, if you use Dojo's AMD you can get issues here.

    It turns out that jQuery gets confused if it sees the JS variable 'define.amd' in the page AND it's not an AMD that it knows about or is set up to be using, Especially if it's Dojo's AMD, since that loader has a baseUrl of where Dojo is located on the server and not where JQuery is located.

    Hence, the suggestion is to steer clear of Dojo's AMD when using JQuery and Dojo on the same page. Note, handlebarsJS is effected by the same issue.

    0 讨论(0)
  • 2021-01-02 18:31

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

    more information :

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

    read this article too:

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

    0 讨论(0)
  • 2021-01-02 18:37

    Yes, it is possible and I am doing that right now. I am using Dojo for its framework and JQuery for presentation. It works seamlessly and there shouldn't be any conflicts. Do read the second article mentioned by diEcho.

    0 讨论(0)
提交回复
热议问题