Google hosted dojox.gfx
I am using the following html to download dojo from Google hosting.
<script src="http://www.google.com/jsapi"></script> <script type="text/javascript">google.load("dojo", "1.1.1");</script> <script type="text/javascript"> dojo.require("dojox.gfx"); ... This is an error on the query string with an error like dojox.gfx undefined. Is there a way to make this work, or does Google not support dojox extensions?
Alternatively, is there another common host that I can use for standard dojo releases?
Unlike when you reference .js files directly from <script> (note that google js api also supports this, see here ), google.load is not synchronous. This means that when your code reaches google.load, it will not wait for the dojo to load fully in order to continue parsing; it will go directly to your dojo.require line and it will not work there because the dojo object will be undefined.
The solution (if you don't want to use the direct <script> tag) is to enclose all of your code that references dojo in the start function and set it as a callback by doing:
google.load("dojo", "1.1.1", {callback: start}); function start() { dojo.require("dojox.gfx"); ... } or
google.setOnLoadCallback(start); google.load("dojo", "1.1.1"); function start() { dojo.require("dojox.gfx"); ... } The best question is why do you need this? If you are developing your local host, just use the relative path, if you are working on a server that accesses the Internet, insert dojo files into it.
Also - make sure you do not fall for the same origin policy
dojox is practically not supported and will be pulled out of dojo -2. There are serious problems with most widgets in dojox, there are only a few good ones.
IMHO dojo has to be self-service, because there are always things you need to rewrite - for example, you need some kind of fix in this dojox.gfx.