Home > Web Front-end > JS Tutorial > Dojo learning points_dojo

Dojo learning points_dojo

WBOY
Release: 2016-05-16 18:20:28
Original
1200 people have browsed it

Since I need to learn the ArcGIS Server JavaScript API, ESRI uses the JavaScript open source framework Dojo in this API, so I first learned some knowledge of Dojo to prepare for future work.
In fact, there are many open source JavaScript frameworks, such as the earliest prototype, the very practical jQuery, Yahoo's Yui, the stunning ExtJS, etc. As for why ESRI adopted Dojo, we don't have to guess. There must be someone who has a reason, so study hard. Dojo is the last word.
Before learning Dojo, you must master some necessary JavaScript knowledge, such as json, etc. Since I thought I could learn JavaScript well in the past, and I am just getting started with ExtJS, it is relatively easier to learn Dojo.
The latest version of Dojo is now version 1.5.0, and you can download the dojo-release-1.5.0.zip compressed file on its official website.
Getting back to the subject, here are some learning points for you, just treat it as a personal note.

Copy code The code is as follows:

1, use dojo.require in a similar way to C programming# Include or import in Java to load the required components
such as dojo.require("dojo.parser"); dojo.require("dijit.form.Button");
2, cross-domain custom module
Dojo configuration, djConfig="baseUrl:'./'"
Register module path, dojo.registerModulePath("dtdg","./dtdg");
Load custom module, dojo.require ("dtdg.foo");
3. The local toolbox module
directly loads the custom module, dojo.require("dtdg.foo");
4. Register events for the object
dojo .connect();
5, convert between json and string
dojo.fromJson(/*String*/ json);//Return JavaScript object, json object
dojo.toJson(/*Object */ json, /*Boolean*/ prettyPrint);//Return string
6, Ajax communication
dojo.xhrGet(/*Object*/ args);dojo.xhrPost(/*Object*/ args) ;
dojo.xhr(/*String*/ method, /*Object*/ args, /*Boolean?*/ hasBody);
7, localization
djConfig="dojo.local:'zh '"
8, controls, layout, etc. are all in dijit
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template