I would like to use ArcGIS JavaScript API 4.3 with jQuery, but I am getting following errors. I searched for a solution and tried it a few (code below), but they didn't work at all. How could I import jQuery without conflict with dojo? I would very much appreciate your assistance.
<script src="https://js.arcgis.com/4.3/"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script type="text/javascript">
define.amd.jQuery = true;
var dojoConfig = {
async: true,
paths: {
jquery: "https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"
}
};
require([
"jquery",
"esri/Map",
"esri/views/SceneView",
"esri/WebScene",
"dojo/dom",
"dojo/dom-style",
'dojo/_base/lang',
"dojo/domReady!"
], function($, Map, SceneView, WebScene, dom, domStyle, lang)
{
Solved! Go to Solution.
You might try loading jQuery before the ArcGIS API for JavaScript. Reference: quickstart-map-phonegap/jquery-gps.html at master · Esri/quickstart-map-phonegap · GitHub
You might try loading jQuery before the ArcGIS API for JavaScript. Reference: quickstart-map-phonegap/jquery-gps.html at master · Esri/quickstart-map-phonegap · GitHub
I am using Wordpress and not loading jquery on my own. Only Edge browser complains about multipleDefine and https://js.arcgis.com/4.11/dojo/jquery.js doesn not exist.
404 Not Found
What exactly is "multipleDefine" trouble Edge, and how do I fix it?
Hi Gregory,
The multiple define errors are indicating there is an ArcGIS JS API module loading conflict. The jquery.js file not found error is a module loader configuration issue within the ArcGIS JS API - not sure why that error is occurring, maybe jquery was specified as a module inside your require() function? I have very limited familiarity with Wordpress, maybe some else on the forum has solved this issue. My suggestion is to make sure the ArcGIS JS API loads after jQuery is loaded within the WP plugin lifecycle. You may have to experiment around a bit, reference: https://codex.wordpress.org/Plugin_API/Action_Reference