Ajax framework-Dojo (II)

Source: Internet
Author: User

Currently, dojo has been upgraded to version 1.0.1. With the upgrade of the version, the location of each package of dojo and the function changes greatly. This is very unfavorable for our developers. Despite this, I was shocked by the power of the dojo feature again and again. The following are some common methods of dojo and the changes brought about by the version upgrade. I will take a note here. Since I have just been in touch with dojo, I will continue to add more content in the future.

1. About the debug system that comes with dojo. (Note: you must first set the isdebug attribute of djconfig to true.)

Old Version: dojo. debug ("---------");

New Version: console. debug ("---------");

2. Event binding in Dojo

Old Version: You can use dojo. event. Connect to bind events to page elements, as shown below:

<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<SCRIPT type = "text/JavaScript" src = "../dojojs/dojo. js"> </SCRIPT>
</Body>
<Input id = "handler" type = "button" value = "test"/>
</Body>
</Html>
<SCRIPT type = "text/JavaScript">...
VaR handlernode = Document. getelementbyid ("handler ");
Function handleonclick (EVT )...{
Alert (EVT + "you clicked the button ");
}
Dojo. event. Connect (handlernode, "onclick", "handleonclick ");
</SCRIPT>

New Version: no corresponding method is found.

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: info-contact@alibabacloud.com 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.