Chapter One dojo teaches you how to get started with Dojo

Source: Internet
Author: User

If you are just practicing dojo, or testing, you can refer to the following steps. The following files are the tools you need to test under windows

1 Tomcat server: Download address choose the right machine model to

2 Dojo Toolkit: Download address because Dojo Toolkit does not have a test page, it is recommended to download the following SDK

3 browser bloggers are using Chrome

The next step is to configure the file.

first, Tomcat .

Tomcat, you can unzip it directly.

There is a startup.batunder the Bin folder and you can run it by double-clicking. Double-click shutdown.bat to stop the server.

After running the server, we enter the URL http://localhost:8080 to see the following page, indicating that the server started successfully.

This default page, in fact, is the E:\tomcat\apache-tomcat-7.0.54\webapps\ROOT directory of the index.jsp, remember this address, 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

See the following page to indicate success.

This means that dojo can be used. your own test cases

We write a test page ourselves, create the page test.html, and put it in the ROOT folder:

 

  

From the toolkit, introduce JS or CSS, note the problem of the path. If you want to use an absolute path, write the full path name. For example, in this article Dojoroot is placed under root, page test.html is also in root, so the relative path bit: "./dojoroot/dojo/dojo.js" absolute path bit: "http://localhost : 8080/dojoroot/dojo/dojo.js"(that is, relative to the server Web root directory)

Introduction of Dojo.js

<script type= "Text/javascript" src= "/dojoroot/dojo/dojo.js" djconfig= "Parseonload:true" >
        </script >

Introducing a 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>, loading Dojo's unique style

<body class= "Tundra" >

Finally, we use a few div to make 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.html can see the following page.

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.