Dojo learning points

Source: Internet
Author: User

To learn about the ArcGIS Server JavaScript API, ESRI uses the JavaScript open-source framework Dojo in this API. So I first learned some Dojo knowledge, so I will be ready for future work.
In fact, there are many open-source JavaScript frameworks, such as prototype, jQuery, Yui of Yahoo, and ExtJS. We do not have to guess why ESRI uses Dojo, some people are sure to learn the truth. Learning Dojo well is the truth.
Before learning Dojo, you must have some necessary knowledge about J avaScript, such as json. In the past, JavaScript thought it was okay, and ExtJS was an entry. It is much easier to learn Dojo.
Now the latest version of Dojo is 1.5.0, on its official website can be downloaded to the compressed file.
Let's get down to the truth. Here are some of my learning points. You should take a personal note.
Copy codeThe Code is as follows:
1. Use dojo. require to load the required parts in a way similar to # include or Java import in C programming.
For example, dojo. require ("dojo. parser"); dojo. require ("dijit. form. Button ");
2. Cross-origin custom Module
Dojo configuration, djConfig = "baseUrl :'./'"
Path of the registration module, dojo. registerModulePath ("dtdg", "./dtdg ");
Load the custom module, dojo. require ("dtdg. foo ");
3. Local toolbox Module
Directly load the custom module, dojo. require ("dtdg. foo ");
4. register events for objects
Dojo. connect ();
5. Conversion between json and string
Dojo. fromJson (/* String */json); // return JavaScript Object, json object
Dojo. toJson (/* Object */json,/* Boolean */prettyPrint); // return a 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 and la s are all in dijit.

Related Article

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: 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.