tags:

views:

63

answers:

2

I am trying to integrate DOJO to my existing struts application. Listed below are the steps I followed.

1.Downloaded DOJO 1.4, copied dijit,dojo and dojox folders under my application folder jsp->js>DOJO

  1. copy paste "dialog via mark up example" (http://www.dojotoolkit.org/reference-guide/dijit/Dialog.html#dijit-dialog)

  2. When I run the application, I am getting javasript error dojo undefined.

What I am missing? Also where is dojo.xd.js? I don't see it under dojo folder

+1  A: 

You are probably missing a reference to the dojo script on your page.

http://www.dojotoolkit.org/reference-guide/quickstart/install.html#quickstart-install

You need to add a <script src="path to where you put dojo"></script> to your page.

smencer
Thank you for quick response.I did put reference to dojo script but it was calling dojo.xd.jslike this<script type="text/javascript" src="jsp/js/dojo/dojo/dojo.js" djConfig="parseOnLoad: true">Since I didn't see dojo.xd.js anywhere in the uncompressed folder,I changed it to dj.js, it is working now.What is all about dojo.xd.js? Where is that file located? Why It didn't come with the version I downloaded but there is the example in dojo website?
Vani
dojo.xd.js is the cross-domain version of the api. It is designed to be referenced from one of the CDN sites (AOL and Google both host versions of Dojo that can be used so you don't have to deploy it locally).
smencer
A: 

Simple alternative is to use the DOJO from CDN - Content Distribution Network (Multiple repositories which has all dijit,dojo and dojox folders . So you don't have to copy anything). Use the following code if you want to use the latest DOJO.

<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.4/dojo/dojo.xd.js"&gt;&lt;/script&gt;

If you want a specific version, then

<script type="text/javascript" src="http://o.aolcdn.com/dojo/&lt;version&gt;/dojo/dojo.xd.js"&gt;&lt;/script&gt;
Sandeep