tags:

views:

702

answers:

1

I want to run Dojo/Dijit with the Google CDN:

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

I've tried 1.3.2, 1.3, 1.2 and all give this same problem. If what I've read is true, I only need to include the dojo.xd.js - then the requires will properly find dijit somehow relative to dojo.

In Firebug I see the following:

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

I'm confused by this, because I if http status=200 is okay - then why is this line showing up in red?

The next line says

could not load 'dijit.Menu'; last tried '../dijit/Menu.js'

I had this working with all the Dojo/Dijit source code local - but I'm determined to get it running with the CDN.

I did some searches, and the best I could find was that Menu.js was included in certain releases, but I think they were talking 1.2 or before.

Same error occurs in the Chrome browser.

Thanks for helping. Neal Walters

More Info Added:

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

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

Here's the "beast" that I'm trying to get working.
http://3wcloud-com-provisioning-qa.appspot.com/testDijit

This was originally a copy of the Dojo Theme demo - and it was working when I was running with Dojo local. It does a delayed/manual parse.

Like I said above, I tried 1.2, 1.3, 1.3.2 and so on, so it was just a matter of timing when I copyied/pasted into my question.

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

Thanks again - I'm going to love Dojo when I over these little humps.

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

+3  A: 

Do you have something strange in your djConfig? The fact that it's spitting out "../dijit/Menu.js" makes it seem like you have a path setting in there.

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

dojo.require('dijit.Menu')

without problem.

Also, the script tag has 1.3.2 but it's loading menu from 1.2 which is strange.

Post a the full source code of what isn't working and that'll help track down the problem.

EDIT AFTER POSTING LINK

Remove these lines from your testDijit page:

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

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

YET ANOTHER EDIT

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

I'm curious why you are so driven on getting the dijit tester running on your app since it seems like it'd be more fun/productive to learn dojo solving problems within your application.

seth
See revisions - I edited my original question because ran out of space in comment.
NealWalters
Change completed - similar result. That was junk left over when I was testing 100 permutations. I've got to gym - need a mental break. Thanks again.
NealWalters
I thought I upvoted all your answers that were on target - I'll go back and check. Meanwhile I'll work through what you posted above.
NealWalters
Basically, I'm taking their full-blown sample, and removing things from it to become my menu/framework - where I put the content in the right panel. So /testDijit is their sample reworked on GAE, and /testDijitMenu is where I have started to size it down to my needs.
NealWalters
I see you added these five ilnes: //added these five requires dojo.require('dijit.PopupMenuItem'); dojo.require('dijit.PopupMenuBarItem'); dojo.require('dijit.layout.LinkPane'); dojo.require('dijit.form.VerticalRuleLabels'); dojo.require('dijit.form.VerticalRule'); The screen doesn't "paint" well without them.How did the themeTester.html demo work without them? How did you know to add them? So removing the extra "junk" outdated/test <script src statements probably made the original error go away. MUCHO GRACIAS AMIGO!
NealWalters
Neal, when an answer solves your problem, remember to accept it (use the checkmark icon below the number giving the up/down votes for the answer): that's fundamental SO etiquette!
seth