File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes DOJO1.2.3/ IE7 /addOnLoad() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "DOJO1.2.3/ IE7 /addOnLoad()" Watch "DOJO1.2.3/ IE7 /addOnLoad()" New topic

DOJO1.2.3/ IE7 /addOnLoad()

Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
I can not get this piece of code to work (I am expecting the page to show me an alert with 1 as the value) and also do not see any errors. What am I missing?

Greg A Watson

Joined: Mar 28, 2006
Posts: 6
Santosh, I've run your code in Firefox & IE7, and it works perfectly fine - your code also looks good. Could it be that the location of dojo.js doesn't match your file system? When the page is loaded, look in Firebug to see if Dojo has bootstrapped - if so, an object named 'dojo' should have been created.

Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
Greg, You are right I had to change the way I was using dojo.js location from src="js/dojo/dojo.js" to src="<%=request.getContextPath()%>/js/dojo/dojo.js" and it worked.

I am still not sure why the page did not show a javascript error in IE7.0 when I was using src="js/dojo/dojo.js" something like "dojo is undefined"?
(FF 3.0.4 does show JS error "dojo is undefined").
[ December 11, 2008: Message edited by: Santosh Ramachandrula ]
I agree. Here's the link:
subject: DOJO1.2.3/ IE7 /addOnLoad()
It's not a secret anymore!