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 so that we can get the set value when loading dojo. js,
PS: Although dojo 0.3 and later versions support post-loading setting, we strongly recommend that you use the code for declaring djconfig as the first script.
A complete djconfig object is defined as follows (values are the default values of dojo)
Dojo_djconfig
<SCRIPT type = "text/JavaScript">
VaR djconfig = {
Isdebug: false,
Debugcontainerid :"",
Bindencoding :"",
Allowqueryconfig: false,
Basescripturi :"",
Parsewidgets: True
Searchids: [],
Baserelativepath :"",
Libraryscripturi :"",
Iepreventclobber: false,
Ieclobberminimal: True,
Preventbackbuttonfix: True,
};
</SCRIPT>
// At the beginning of dojo 1.4, the introduction of dojo. Ready (); is very similar to the ready method of jquery. It is estimated that they are interested in learning juery, a natural semantic programming language.
The usage of dojo. Ready in the following code.In fact, dojo. Ready () is an alias for the dojo. addonload () method.!
<title>dojo test</title>
<script type="text/javascript" src="js/dojo.js"></script>
<body>
<script type="text/javascript">
dojo.ready(function () {
dojo.byId("box").setAttribute("class", "tbox");
});
</script>
<div id="box"></div>
</body>
Next let's take a look at Dojo. addonload ();
<title>dojo test</title>
<script type="text/javascript" src="js/dojo.js"></script>
<body>
<script type="text/javascript">
dojo.addOnLoad(function () {
dojo.byId("box").setAttribute("class", "tbox");
});
</script>
<div id="box"></div>
</body>
Are you ready!