Bootstrapping
Tip
This section discusses some material that you may want to initially skim over and come back to review once you feel well acquainted with Dojo.
Before you can use Dojo at all, you have to somehow get it into
the page. Regardless of whether you install Dojo locally or load it
via AOL's CDN, you simply provide a SCRIPT tag that points to the file that
loads some JavaScript code, and then magic elves inside of your web
browser miraculously causes everything to "just work," right? Well,
not quite. Like most other things in computing, it all comes back to
pure and simple automation, and Dojo's bootstrap process is not
different.
Tip
The term "bootstrap" refers to the idea of "pulling yourself up by your own bootstraps." In other words, it's the idea of getting up and running without help from anywhere else. The notional idea of Dojo bootstrapping itself is the same concept as your computer "booting up" when you turn it on.
For the record, Example 1-2 is the absolute minimum effort that is generally required to get some XDomain Dojo goodness into your HTML page. What's especially notable about loading Dojo from the CDN is that less than 30KB of data comes across the wire. Chances are good that you'll use the previous code block, or some variation of it, quite often. Save yourself some typing by copying it into a template that you can reuse.
Example 1-2. A minimalist application harness example
<html> <head> <title>Title Goes Here</title> <!-- A lightweight style sheet that smoothes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access