Download Library
First, download the Dojo library: http://www.dojotoolkit.org/downloads
With the convenience of testing, I will extract the files to the "Js/dojotoolkit" folder of the Web server and, if you prefer, you can prefix the version number. The final directory structure should look like this:
It is important to identify the path to the Dojo.js file. As long as dojo.js can be properly loaded into the page, package system automatically handles references and dependencies on related modules.
The Dojo Book (http://dojotoolkit.org/book/dojo-book-0-9/part-1-life-dojo/quick-installation) provides a great deal of guidance and tutorials, A more in-depth description of the way to get different versions of dojo.
You can also introduce scripts from Google's common library, as follows: Http://ajax.googleapis.com/ajax/libs/dojo/1.3.1/dojo/dojo.xd.js
Basic framework
The following is the basic framework for a dojo program:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>Dojo Toolkit Test Page</title>
<!-- 装入Dojo 基本库 -->
<script type="text/javascript" src="js/dojotoolkit/dojo/dojo.js"
djConfig="parseOnLoad:true, isDebug:true">
</script>
<script type="text/javascript">
/* 其他的脚本程序 */
</script>
<style type="text/css">
/* 样式表在这 */
</style>
<body><!-- 页面内容 -->
<div id="contentNode">
<p>一些内容</p>
</div>
</body>
Configuring Dojo Startup Parameters
Dojo should be configured for parameters when loaded, with the two most important parameters being parseonload and isdebug. The first parameter determines whether the Dojo component and the built-in label are parsed when the page is loaded, and the second parameter turns debugging information on or off. There are two modes of configuration:
The first method is configured in the <script> tab as follows:
<script type="text/javascript" src="js/dojotoolkit/dojo/dojo.js"
djConfig="parseOnLoad:true, isDebug:true">
</script>
The second way is to create a global variable djconfig before dojo.js mount, as follows:
<script type="text/javascript">
var djConfig = {
isDebug:true,
parseOnLoad:true
};
</script>
<script type="text/javascript" src="js/dojotoolkit/dojo/dojo.js"></script>