Reputation: 21445
I started learning Dojo and came across how to include Dojo using CDN by below code which is defined in Dojo Tutorial
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"
data-dojo-config="async: true">
Here why they have missed http
? Is that intentional, my program is not working unless I add http
in my code.
Also what is the use of data-dojo-config
attribute, I don't see any difference in my basic program even if I remove this attribute. When we need to use this attribute?
When I access some other examples, I see it differently:
data-dojo-config="isDebug: 1, async: 1, parseOnLoad: 1"
What are these properties, when to use them?
Upvotes: 0
Views: 1065
Reputation: 3330
he data-dojo-config
is the configurations paramenter for the the dojo loader and parser.
This is similar to the configurations parameters which you set for loading a database server for instance.
What is dojo loader and parser?
dojo loader: Loads the javascript modules ( javascript files ) synchronously or asynchronously.
dojo parser: The function of dojo parser is to parse and convert HTML code into dojo widgets wherever necessary.
The data-dojo-config
can be set only at the start of the dojo application.
They cannot be changed during run time.
If they are not set than they take the default values.
The can be set to 1
(or true
) or 0
(or false
)
isDebug - sets the debug level for the dojo application.
async - (default is 1) whether the dojo javascript modules should be loaded synchronously or asynchronously.
parseOnLoad - When set to true the dojo parser automatically parses the HTML document and converts data-dojo-elements to dojo widgets. If set to false than you need to explicitly call the dojo parser to parse the HTML document.
Upvotes: 2