Select to view content in your preferred language

Issue with dojo.require statement

1284
4
Jump to solution
01-21-2014 06:19 AM
BrianLord1
Deactivated User
Good Morning,

I am currently trying to set up the Citizen Service Request app (from the arcgis for local government app gallery) and continue to run into a problem.

While debugging I encounter this error...
"Microsoft JScript runtime error: xhrFailed"

The error happens everytime the script reaches the following lines.
dojo.require("js.config"); dojo.require("js.infoWindow"); dojo.require("js.date");


I have re-ordered these and the error happens no matter which one it hits first. 

The files exist and within each one they start with the following code (this is from the config.js file)...
dojo.provide("js.config"); dojo.declare("js.config", null, {


Any help would be greatly appreciated.

Thanks,
Mark
0 Kudos
1 Solution

Accepted Solutions
JeffPace
MVP Alum
does your dojoConfig say where "js" is?

i.e.

<script type="text/javascript" >             dojoConfig = {                 parseOnLoad: false,                         async:true,                 baseUrl: '/arcgis_js_api/library/3.8/arcgis/js/dojo/dojo',                 packages: [{name: 'org', location: hostPath + '/..' + '/mobile/org'},                     {name: 'agsjs', location: hostPath + '/..' + '/mobile/agsjs'},                     {name: 'com', location: hostPath + '/..' + '/js/com'},                     {name: 'utilities', location: hostPath + '/..' + '/mobile/utilities'}                 ],                 isDebug: false,                 usePlainJson: false             };         </script>

View solution in original post

0 Kudos
4 Replies
JeffPace
MVP Alum
does your dojoConfig say where "js" is?

i.e.

<script type="text/javascript" >             dojoConfig = {                 parseOnLoad: false,                         async:true,                 baseUrl: '/arcgis_js_api/library/3.8/arcgis/js/dojo/dojo',                 packages: [{name: 'org', location: hostPath + '/..' + '/mobile/org'},                     {name: 'agsjs', location: hostPath + '/..' + '/mobile/agsjs'},                     {name: 'com', location: hostPath + '/..' + '/js/com'},                     {name: 'utilities', location: hostPath + '/..' + '/mobile/utilities'}                 ],                 isDebug: false,                 usePlainJson: false             };         </script>
0 Kudos
BrianLord1
Deactivated User
Thanks for the response Jeff!

Here is the code that came in the template.

<script type="text/javascript">
            var dojoConfig = {
                async: false,
                parseOnLoad: true,
                mblHideAddressBar: false,
                packages: [{
                    name: "js",
                    location: location.pathname.replace(/\/[^/]+$/, '') + '/js'
                }]
            };
    </script>


Do I need to change something here?  None of the other templates I have used from the local government gallery have required me to change something there.

I have included a screenshot of the folder structure for this site.

Thanks again!
0 Kudos
BrianLord1
Deactivated User
Found the answer. 

Thanks to Jeff's post, I took another look at my code and realized I had changed a variable along the way that was causing my issues.
0 Kudos
JeffPace
MVP Alum
glad you found it!
0 Kudos