Introduction
The DD Framework is supported by modules. Modules work as extensions to the framework's core. As most projects only require specific functionality it is important to only include modules that are needed.
File Structure
index.html
- scripts
- dd
- dd.js (or dd.legacy.js)
- ...
- app
- app.js
- app.overlay.js
- images
Modules
Once the dd.js (or dd.legacy.js) file is loaded all included modules and project files will be downloaded. The order they are listed is the the order the files will be initialized. The chart makes it easier to understand.
| | Modules | Project File |
| Load Before DOM | Yes | Yes |
| Initialize Before DOM | Yes | No |
New Project
When you have a project for the web it will most likely look like this.
<script type="text/javascript" src="scripts/dd/dd.js"></script>
<!-- <script type="text/javascript" src="scripts/dd/dd.legacy.js"></script> -->
<script type="text/javascript">
dd({
modules:[
"http" // Loads in scripts/dd/dd.http.js
],
projects:{
"foo":[ // Loads in scripts/foo/foo.js
"bar" // Loads in scripts/foo/foo.bar.js
]
}
});
</script>Then your project file (scripts/foo/foo.js). Note: the "scripts/" is determined by where dd.js (or dd.legacy.js) is loaded from (the standard in the wiki being scripts/).
dd.project.foo({
init:function()
{
dd(dd.body).clearElements();
dd(dd.body).addElement("h1", "Header Text");
dd(dd.body).addElement("p", "Foo Project.");
}
});HTML vs XHTML (Optional Read)
This is just a reminder that the core checks for the xmlns attribute when determining if a page is HTML or XHTML.
<html xmlns="http://www.w3.org/1999/xhtml">
If you need to use this in a module or code shared between HTML and XHTML projects use the dd.isXHTML property.
Continue... Getting Started Web Application