Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DOJO1.2.3/ IE7 /addOnLoad()

 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Greg
 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic