Dojo learning and using (02), djconfig configuration explanation

Source: Internet
Author: User

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!

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