Hello world! The time has come, in the many languages you have learned, which is not learned from this? But before we do, we have to build a development environment, like when we first started to learn Java, or we need to install the JDK, configure the environment variables, and so on, HelloWorld will be obediently displayed on the command line.
For scripting languages, the development environment is the text Editor + Language Pack (dojo.js), which is much simpler for learning JavaScript, and only needs to be supported by a mainstream browser, so the browser can parse it. For the development environment of dojo, there are several categories: Introduction to several ways to build a dojo environment download dojo files in http://dojotoolkit.org/download download the latest version of Dojo, the download of the official version does not include the build tool, build tools can be obtained from the source. The extracted files generate a folder named Dojo-release-x.y.z, where "X", "Y" and "Z" correspond to the major version number, the minor version number, and the patch number for a particular version, and you can see the internal folder structure classification as we did in the previous article Dojo Learning Note one: Which of the categories described in "Knowing Dojo" is consistent: Base (dojo/dojo.js), Core (Dojo), Dijit (Dijit), DojoX (DojoX), and util (util). CDN CDN is the Content Delivery network, which is the contents distribution net. Simplicity is the use of the Dojo Toolkit through the Dojo Resource bundle on the link network. Commonly used CDNs are:
Google CDN: <script src= "//ajax.googleapis.com/ajax/libs/dojo/1.8.3/dojo/dojo.js" ></script>yandex CDN (Europe): <script src= "//yandex.st/dojo/1.8.3/dojo/dojo.js" ></script>
Building an internal CDN reduces the time it takes to load an extranet CDN resource by building a local CDN. 1. Download the release source package from the official version: Take the 1.8.3 version for example. Download.dojotoolkit.org/release-1.8.3/dojo-release-1.8.3.tar.gz 2. Unpack the package and run the build script CD dojo-release-1.8.3-src\util\ BuildScripts build profile=baseplus action=release optimize=shrinksafe version=1.8.3 loader=xdomain xdDojoPath=your/ Dojo/cdn/path
Parameters |
Describe |
Profile |
The value corresponds to the file name in the Util\buildscripts\profiles directory |
Action |
Clean, relase, help |
Version |
It is generally based on the version of dojo that is downloaded |
Optimize |
Comments: Delete comments, Shrinksafe: Brute force compression, Shrinksafe.keeplines: Row compression, Packer: Package into a single file |
Loader |
Default: No cross-domain, Xdomain: cross-domain |
Xddojopath |
URL path on a server in a CDN |
3. When the command execution is finished and deployed to the server (under URL mapping), it can be used just like an external CDN file. Once you have prepared your Dojo development environment, you can start learning about several of the dojo's components. Next, learn some of the methods and objects in dojo that are different from native JavaScript.
Describes several ways to build a dojo environment