• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XDomain

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The current architecture of my project requires static content to be served on a separate host as the java application, which requires us to use the Dojo XDomain build.

XDomain isn't very straight forward, and requires most code to be within a dojo.addOnLoad() and making sure they're ordered appropriately. Are there any suggestions on how to better use Dojo XDomain in a way that isn't noticeable during development?
 
Author
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Justin,

Well I try to put all initialization code inside the dojo.addOnLoad(); function anyway, just in case. That way it is easier to keep everything in one place, and prevent page sprawl.

What is important when using cross-domain loading of Dojo is to use baseUrl and modulePaths in djConfig, like;

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.2.0/dojo/dojo.xd.js"
djConfig="parseOnLoad: true, baseUrl: './', modulePaths: {layout: 'wcn/layout', data: 'wcn/data'}, debug:true, debugAtAllCosts:true"></script>

This is an example that I use right now for a project, with maximal debugging switched on. using the above strategy makes it possible to load Dojo cross-domain and still have your own directory with a couple of custom widgets locally (in the same dir as the index.html file).

This is especially sueful for Google App Engine projects, since Dojo is over 1000 files

So, having custom widgets, and using adOnLoad anyway is my best recommendations.

Cheers,
PS
 
reply
    Bookmark Topic Watch Topic
  • New Topic