Failed to load 'dijit.Menu'

I want to run Dojo / Dijit from Google CDN:

<script type="text/javascript" 
         src="http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dojo/dojo.xd.js">
</script>

      

I've tried 1.3.2, 1.3, 1.2 and they all give the same problem. If what I read is correct, I need to include dojo.xd.js - then the request will correctly find dijit in some way relative to the dojo.

In Firebug I see the following:

http://ajax.googleapis.com/ajax/libs/dojo/1.2/dijit/Menu.js 200 OK

I am confused by this because I, if http status = 200 is ok - then why is this line showing in red?

The next line says

failed to load 'dijit.Menu'; last try '../dijit/Menu.js'

It worked for me with all the Dojo / Dijit local source code, but I decided to run it from a CDN.

I did a few searches and the best I could find was that Menu.js was included in some releases, but I think they said 1.2 or earlier.

The same error occurs in the Chrome browser.

Thanks for the help. Neil Walters

Added:

Thanks for the example. I took it and got a simple menu:

http://3wcloud-com-provisioning-qa.appspot.com/testDijitMenuOnly

Here is the "beast" I am trying to work with.
http://3wcloud-com-provisioning-qa.appspot.com/testDijit

This was originally a copy of the Dojo Theme demo and it worked when I was working with Dojo locally. It performs deferred / manual analysis.

As I said above, I tried 1.2, 1.3, 1.3.2 and so on, so it was a matter of time before I copied / pasted into my question.

And OOPS - I didn't have djconfig - so I added that - but a similar problem - only more explicit paths.

Thanks again - I'll love Dojo when I'm over those little humps.

This is the page I'm trying to reproduce: http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/themes/themeTester.html?theme=soria

+2


source to share


1 answer


Do you have something strange in your djConfig? The fact that it spits out "../dijit/Menu.js" seems like you have a path setting.

I have set up a simple demo page that uses the Google CDN and does the following:

dojo.require('dijit.Menu')

      

no problem.

Also, the script tag has 1.3.2, but it loads the menu from 1.2, which is weird.

Post the complete source code of what's not working to help track down the problem.



EDIT AFTER LINK POSITION

Remove these lines from the testDijit page:

<script type="text/javascript" src="/dijit/dijit.js"></script>

<script type="text/javascript" src="/dijit/dijit-all.js" charset="utf-8"></script>

      

GIVE ANOTHER CHANGE

Call me crazy (since you don't seem to approve or endorse the answers on SO, making this kind of a no-op for me), but I got it working with a CDN here. ... It still has problems because the CDN doesn't have all the test files on it (e.g. dijitTest.css and countries.json). You can download it and diff on your ow file to see what I changed. I was basically adding a bunch of missing requires and changing the paths to CSS and images. You also have a script tag referencing /dojo.js

in your file.

I'm curious why you are making it so hard to work with a digital tester on your application, as it seems like it would be more interesting / productive to learn the dojo to solve problems in your application.

+4


source







All Articles