SOS

Shane O'Sullivan's technical blog… really ties the room together

Using a different filename than dojo.js

Posted by Shane O'Sullivan on September 17, 2006

By default, Dojo requires that it’s main file be called dojo.js. This is essentially because it needs to be able to find the path to the folder in which it is stored so it can remotely load resources.

However, there are situations where you’d like to have multiple different builds ready to use in the same folder, optimised for different pages or applications. For example, one file could have the dojo.widget package for applications that use widgets and you could call it dojo_widget.js, whereas another could just have the dojo.storage package and be called dojo_storage.js.

To enable this behaviour, you have to tell Dojo the base path to it’s folder. To do this, set the djConfig.baseScriptUri in the page using the non-standard file. E.g.

<html>

<head>

<script type=”text/javascript”>

djConfig = {djConfig.baseScriptUri=”/myapp/js/dojo”};

</script>

<script type=”text/javascript” src=”/myapp/js/dojo/dojo_widget.js”></script>

</head>….

And it should all work out just fine!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: