I want to include a component written by someone in my ArcGIS web application.
However, when I turn it on, I always encounter the multipleDefine problem in the console window.
There are two ways to solve this problem by moving the script below the component.
<script src="https://js.arcgis.com/3.14/"></script>
or declaring a snooze on a script
<script defer src="https://js.arcgis.com/3.14/"></script>
However, this does not solve the root of the problem, because basically the component will not use AMD, but rather a global browser to declare it
Do you have any ideas? I have included jsFiddle for this:
https://jsfiddle.net/h9ztsrm3/5
Just turn on the console window and you may see a problem with several problems, thanks!
jsFiddle, arcgis dojo AMD, AMD, , , ,
https://jsfiddle.net/w33zwjhx/
:
1) - arcgis, asp.net mvc 5 bootstrap 3
2) asp.net mvc 5 script
<script src="/Scripts/jquery-2.1.4.js"></script>
<script src="/Scripts/bootstrap.js"></script>
3)
<script src="/Scripts/esri/3.14/init.js"></script>
4) 3 dojo, arcgis dojo
5) , , .
https://github.com/ehpc/bootstrap-waitingfor/blob/master/src/waitingfor.js
<script src="/Scripts/ehpc/waitingdialog/src/js/waitingdialog.js"></script>
6) , dojo arcgis, "if"
if (typeof define === 'function' && define.amd) {
define(['jquery'], function ($) {
return (root.waitingDialog = factory($));
});
}
7) jsFiddle
8) , , - , define (['jquery']) -
http://ifandelse.com/its-not-hard-making-your-library-support-amd-and-commonjs/