0

I have written an application that relies on Dojo (version 1.8) hosted on the Google CDN. The code looks like this and works fine:

<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8/dojo/dojo.js"></script>
<script>
require(["dijit/form/TextBox", "dijit/form/Button", "dijit/form/Select", "dijit/form/ComboBox", "dojo/store/Memory", "dijit/Tooltip", "dojo/domReady!"],function(TextBox, Button, Select, ComboBox, Memory, Tooltip) {
// my code here
});
</script>

Now, I am trying to get a local, simple build of dojo for users who don't have access to the CDN. I went to build.dojotoolkit.org, selected my modules, and retrieved a single custom build dojo.js (size ~400 kb). I then uploaded it to my server and modified my code:

<script src="pathtoserver/pages/dojo.js"></script>
<script>
require(["dijit/form/TextBox", "dijit/form/Button", "dijit/form/Select", "dijit/form/ComboBox", "dojo/store/Memory", "dijit/Tooltip", "dojo/domReady!"],function(TextBox, Button, Select, ComboBox, Memory, Tooltip) {
// my code here
});
</script>

This is not working. I assume that I am missing a simple step, for example the need to declare a config, but unfortunately I couldn't find any tutorial or example on how to work with a simple build.

[Update] The errors I am getting are 404 not found for the following files:

  • pathtoserver/pages/resources/blank.gif
  • pathtoserver/dojox/gfx/svg.js

Of course I don't have anything at those locations, I only uploaded to the server the content of the zip files returned by the online build tool: dojo.js and the nls folder with localization files.

Danubian Sailor
  • 21,505
  • 37
  • 137
  • 211
Christophe
  • 24,147
  • 23
  • 84
  • 130

1 Answers1

0

More than dojo.js may be required, such as localization bundles, templates (if not inlined) etc. build.dojotoolkit.org should give you a zip to use. Also, take a look at the network panel and it should tell you what's missing.

peller
  • 4,435
  • 16
  • 20
  • thx! I followed your advice and updated the post with more info. The localization bundles are in place. – Christophe Nov 22 '12 at 03:41
  • that's odd. I don't see anything in your code which references svg, and the gif shouldn't keep your page from loading. Anything else relevant on your page? You could try overlaying the zip it gives you on top of a standard Dojo release and see if it helps. Not sure why that would be necessary. – peller Nov 26 '12 at 17:14
  • I didn't put the full code, there's a second step for charting. The test page is here: http://usermanagedsolutions.com/Demos/Pages/ASPXtemplate.aspx . I added a blank image at http://usermanagedsolutions.com/Demos/Pages/resources/blank.gif to address the first error message but the form still looks weird. The one from the CDN works fine: http://usermanagedsolutions.com/Demos/Pages/MiniBIEditMode.aspx – Christophe Nov 26 '12 at 17:24