Created
March 3, 2010 12:23
-
-
Save briancavalier/320573 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- | |
Add theme CSS and Enable parseOnLoad | |
Most widgets need some theme CSS or they'll look terrible. You can | |
reference it on the Google CDN, or host it yourself. | |
Likewise, if you don't enable parseOnLoad, you'll have to manually | |
invoke the parser. It's just much easier to get started by | |
enabling parseOnLoad. | |
--> | |
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dijit/themes/nihilo/nihilo.css"> | |
<!-- | |
Add a dojo script tag | |
Obviously, without this, nothing much is going to work. The easiest | |
thing to do is point to the Google CDN hosted version, but again, you | |
can host it yourself if you like. | |
--> | |
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/dojo.xd.js" type="text/javascript" charset="utf-8" djConfig="parseOnLoad: true"></script> | |
<!-- | |
Load dojo.parser and widgets | |
If you use declarative style widgets (as in this example), you need to | |
load the parser, in addition to enabling parseOnLoad so that dojo will | |
parse the page and auto-create widgets. | |
For each widget you use, you'll need to dojo.require it. | |
--> | |
<script type="text/javascript" charset="utf-8"> | |
dojo.require("dojo.parser"); | |
dojo.require("dijit.layout.ContentPane"); | |
// ... | |
</script> | |
</head> | |
<!-- | |
Add theme class | |
For the theme CSS to be applied, you have to add the theme's class. | |
The easiest thing to do is add it to the body element. You can scope | |
it more tightly if you want or need. | |
--> | |
<body class="nihilo"> | |
<!-- | |
Create some widgets | |
For declarative style, this means adding the dojoType attribute | |
to elements in your HTML. | |
--> | |
<div id="cool-widget" dojoType="dijit.layout.ContentPane" href="..."> | |
<!-- ... --> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment