Has anybody used Dojo and JQuery in the same project?

前端 未结 3 641
清酒与你
清酒与你 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条回答
  •  萌比男神i
    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.

提交回复
热议问题