Dojo QuickStart Quick Start Tutorial (2) Basic framework

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.