Select to view content in your preferred language

Microsoft JScript runtime error: xhrFailed when switch V2.5 to V3.5

3974
2
Jump to solution
01-28-2014 05:21 AM
ShaningYu
Honored Contributor
Got  Microsoft JScript runtime error: xhrFailed
and  Microsoft JScript runtime error: Object doesn't support this property or method
when switch V2.5 to V3.x (e.g. 3.5 or 3.8).
In V2.5 (or 2.7), I loaded the following 'requires'
      dojo.require("dijit.dijit"); // optimize: load dijit layer
      dojo.require("dijit.layout.BorderContainer");
      dojo.require("dijit.layout.ContentPane");
      dojo.require("dijit.form.Button");
      dojo.require("esri.map");
      dojo.require("esri.layers.FeatureLayer");
      dojo.require("esri.dijit.BasemapGallery");
      dojo.require("dijit.TitlePane");
      dojo.require("esri.tasks.query");
      dojo.require("dojo.data.ItemFileReadStore");
      dojo.require("dijit.layout.AccordionContainer");
      dojo.require("agsjs.dijit.TOC");
In V3.x, added the 2 below:
      dojo.require("dojo.dom");
      dojo.require("dojo.domReady!");
When I run the program, it breaks at init.js[dynamic] Line 265:
  require({cache:{"esri/layers/TimeReference":function(){ ... }  - as long as hundreds of lines.
Then I opened Fiddler2.  After the result of 302 on js.arcgis.com  /3.8/, I got some result of 502, e.g. the 1st one on  forums.arcgis.com//ajax.php?do=quickedit&p=361501 
The 502 means  Bad Gateway.
Hopefully, you can share your experience to help me this issue.  Thanks in advance.
0 Kudos
1 Solution

Accepted Solutions
ShaningYu
Honored Contributor
Updated my script in API V3.8.  The prob. was identified to be
      dojo.require("agsjs.dijit.TOC");
In V3.8, it needs defining the 'agsjs'
      var djConfig = {
          parseOnLoad: true,
          baseUrl: './',
          modulePaths: {
                            'agsjs': 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs'
              //'agsjs': 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/1.04/build/agsjs'  // in V2.x
          }
      };

View solution in original post

0 Kudos
2 Replies
ShaningYu
Honored Contributor
Refer to http://forums.arcgis.com/threads/101672-Error-502-Bad-Gateway-at-forums.arcgis.com-ajax.php-do-quick....  It is actually the conflict between JS API 3.x and jquery.  Using JS API 2.x should be fine.  However, some updated functions in 3.x can't be used.
0 Kudos
ShaningYu
Honored Contributor
Updated my script in API V3.8.  The prob. was identified to be
      dojo.require("agsjs.dijit.TOC");
In V3.8, it needs defining the 'agsjs'
      var djConfig = {
          parseOnLoad: true,
          baseUrl: './',
          modulePaths: {
                            'agsjs': 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs'
              //'agsjs': 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/1.04/build/agsjs'  // in V2.x
          }
      };
0 Kudos