ArcGIS JavaScript API with jQuery: Error: multipleDefine

4151
3
Jump to solution
03-28-2017 02:49 PM
MakikoShukunobe1
Occasional Contributor

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)
    {
Tags (1)
0 Kudos
1 Solution

Accepted Solutions
AndyGup
Esri Regular Contributor

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 

View solution in original post

3 Replies
AndyGup
Esri Regular Contributor

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 

View solution in original post

GregoryBologna
Occasional Contributor

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

  • Code: NoSuchKey
  • Message: The specified key does not exist.
  • Key: br/js/4.11/dojo/jquery.js
  • RequestId: 6F4FCBCE6ED615D7
  • HostId: K/COu9ahK7kyQ+jalZPmJTIMiOYTCYJhGz9YRi3k8f6Qc27asDFWsPwsm/JYTeLc4QXyIOrWdLI=

An Error Occurred While Attempting to Retrieve a Custom Error Document

  • Code: NoSuchKey
  • Message: The specified key does not exist.
  • Key: error.html

What exactly is "multipleDefine" trouble Edge, and how do I fix it?

0 Kudos
AndyGup
Esri Regular Contributor

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