How to get started with dojo

Source: Internet
Author: User

If you only want to practice dojo or perform a test, refer to the following steps. The following files are all tested in windows.

Required tools

1 Tomcat server: select the appropriate machine model.

2. dojo Toolkit: Since the dojo toolkit does not have a test page, we recommend that you download the following SDK

3 browser bloggers Use Chrome

 

Then you can configure the file.

 

First, Tomcat

Tomcat, directly decompress it.

The bin folder containsStartup. bat, Double-click to run. Double-clickShutdown. batStop the server.

After running the server, enter the URLHttp: // localhost: 8080The following page indicates that the server is successfully started.

This default page is actuallyE: \ Tomcat \ apache-Tomcat-7.0.54 \ webapps \ RootIndex. jsp in the directory. Remember this address, which will be used later.

Dojo Toolkit

After decompression, modify the folder name dojoroot and put it in the root directory. Enter the following URL

  Http: // localhost: 8080/dojoroot/dijit/themes/themetester.html

If you see the following page, the operation is successful.

This indicates that dojo can be used!

Test Cases

Create a test pageTest.html, Put inRootFolder:

  

Introduce JS or CSS from the Toolkit and pay attention to path issues. If you want to use an absolute path, you need to write the full path name. For example, in this document, dojorootis stored in the root directory, and the page test.html is also in the root directory. Therefore, the relative path bit is :"./Dojoroot/dojo. js"Absolute path bit :"HTTP: /localhost: 8080/dojoroot/dojo. js"(Relative to the web root directory of the server)

Introduce dojo. js

<script type="text/javascript" src="./dojoroot/dojo/dojo.js" djConfig="parseOnLoad:true">        </script>

 

Introduce specific CSS

<style type="text/css">            @import "./dojoroot/dijit/themes/tundra/tundra.css";            @import "./dojoroot/dojo/resources/dojo.css";        </style>

 

Dynamic Loading of specific JS

<script type="text/javascript">            dojo.require("dojo.parser");            dojo.require("dijit.layout.ContentPane");            dojo.require("dijit.layout.TabContainer");</script>

 

In <body>, load the unique dojo style

<body class="tundra">

 

Finally, we use several divs to create a tab.

<div class="formContainer" dojoType="dijit.layout.TabContainer">            <div dojoType="dijit.layout.ContentPane" title="Personal">                123             </div>            <div dojoType="dijit.layout.ContentPane" title="Address">                321            </div>            <div dojoType="dijit.layout.ContentPane" title="phone">                456            </div>        </div>

 

Run page

  HTTP: /localhost: 8080/test.htmlYou can see the following page.

 

Reprint Note: http:// I .cnblogs.com/EditPosts.aspx? Postid = 3810785

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.