First download the dojo Library: http://www.dojotoolkit.org/downloads
Put it for testing. I will decompress the file to the "JS/dojotoolkit" folder of the Web server. If you want to, you can fix the version number. The final directory structure should be like this:
It is important to clarify the path of the dojo. js
development of various types of controls
Dojo itself provides a relatively complete control, just because of historical reasons, has not been deeply studied.
The dojo controls are collectively called Dijit, and to write the dojo version of the Hello World control, you don't have much knowledge:
A control is a JS cl
A. Dojo IntroductionDojo is a JS toolset, an object-oriented JS framework (more in the widget to reflect this), according to the function into multiple module, each module is divided into multiple package, according to the needs of the program to import different package, similar to Java.
Official website: http://dojotoolkit.org/
Operations Guide: Http://manual.d
As a fully functional JS toolkit, Dojo provides a unified Dom operation method. Dojo. byid
The dojo. byid function allows you to select a DOM node through the ID attribute. This function is an alias for the standard document. getelementbyid function, but it is short and easy to write.
Dojo is a good thing, but it is really not easy to make full use of it. Many controls and things are involved.
There is a certain amount of time required. A previous company project was a boss website. The customer service had high requirements on AJAX because it had to be operated frequently,
So Ajax is needed, especially for refreshing. It uses dojo + DWR + spring, and the front end is completely
the page URL, and when the value is true, Dojo will first read the other properties of djconfig from the URL parameter, such as: http:// Server/dojodemo.htm?djconfig.debugcontainerid=divdebug
Basescripturi, generally do not need to set, Dojo will automatically according to the path you reference dojo.js set this value, for example, , the automatically obtained value is ... /
five and the last five. Under dojo, how do we generate page numbers and generate pages?
Next, let's look at the code displayed on the page of the dojo page, which shows the structure of the page.
The HTML code alone does not show how paging is implemented. The next step is to see how paging data is displayed in the background through the JS control interface.
classes in a file), and the name of the package and the name of the module can be different, such as: The package Dojo.widget.Button defines the Dojo.widget.html.Button
Basically you should think that the package and module, though closely related, are two completely different entities
Why is there a concept of modules and packages?
Why is there a concept of modules and packages? In order to meet the needs of your application just to load the things it uses, taking advantage of the advantage
path to the baseurl or absolute path; main, it is an optional parameter. The default value is "Main", which is used to find and correctly load the package that the module user tries to reference. For example, if you write require "dojo" in the Code, the actual file to be loaded is "dojo/Main. js ".
The management module is crucial because the number of depende
have been the js scripts we 've seen all the time that have made a bad impression on everyone. js is originally an object-oriented language and we have seen many structured programs written by it ). taking a look at this article, my implementation is also inspired by it. The extension is to reference the event subscription and publishing mechanism of Dojo.
Let's
(Dojo.byid (" Debugbutton ")," click ", Function () { require (["./perspectives/debug "], function (perspective) { Perspective.open ();}); By referencing the Reqire module instead of the global require function, we can use a relative path to load the module, which is context intelligence.ExportsExports the function of this module is similar to that of exports in node. js, which is used to export methods or variables of the current module. In
cohesion and object-oriented features.
3. Various controls developed based on 2
The controls provided by Dojo are also comprehensive, but they have not been thoroughly studied for historical reasons.
Dojo controls are collectively referred to as DIJIT. To write a Hello World Control for the Dojo version, you need to know little about it:
◆ A control is a
Dojo learning and using (2), djconfig configuration explanation
Djconfig is a global configuration switch of the dojo library. Or a global set object for dojo.It allows you to control the behavior of dojo.
First, we need to declare the djconfig object before referencing dojo. js
Before referencing Dojo.js, it is a good idea to declare djconfig objects so that you can get the values you set when you load Dojo.js, although the dojo support after the 0.3 version is set after loading, it is strongly recommended that you declare the Djconfig code as the first script:
A complete Djconfig object is defined as follows (values are the default values of Dojo)
flexible method allows us to switch between development, testing, and production environments freely.Method 4: top-level modules
Applicable to: large applications with many modules
Another common method for smoothing between the development environment and the production environment is to create a top-level module to introduce the required modules for a page in this top-level module. In this way, you can specify this top-level module for a layer in the dojo
Official Address: http://dojotoolkit.org/reference-guide/1.10/dojo/_base/array.html#dojo-base-array
The array module dojo is well encapsulated. If you want to call it, you must first load the module:
require(["dojo/_base/array"], function(array){ // array contains the features});
Indexof ()
Returned value: the positi
As a Domino developer, the development of browser applications is an important part of this. However, there are many new techniques and methods in browser application development. How to apply these new technologies and methods to the domino environment is an important issue that domino developers need to face.
At present, we are in the era of Web 2.0, in this great era, there is a large number of browser technology, which is representative of Ajax. With Ajax, we can allow clients to exchange d
Previous articles about how to add amd support to dojo 1.6ArticleWe mentioned that although dojo1.6 does not have an AMD loader, Dojo can be loaded as an AMD module by any standard amd loader (such as requirejs)
Some readers will ask how to implement it later. This article will do some research.
We need to download some materials before getting started.
First of all, we would like to thank Ben hockey
We often use some alias methods to use our favorite js library. For more information about javascript, see. For example, the following code is often seen in jQuery.
The Code is as follows:
(Function ($ ){// Some code}) (JQuery)
In this way, you can use $ to replace jQuery;
You can write in mootools as $ represents a set in mootools.
The Code is as follows:
(Function ($ ){// Do something.}) (Document. id)
In
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.