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