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.