This file contains hidden or 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
// this is 'raw' javascript to load dojo, stylesheets, the app, etc. | |
// this file is all that needs to be included in the host page. | |
// this technique doesn't dojo.addOnLoad because it assumes that the | |
// app code will use dojo.addOnLoad as necessary. | |
// also, this doesn't load dojo.css as a 'reset' since it assumes that | |
// it is being loaded into an already established environment and it | |
// doesn't include loading the css for a dijit theme. |
This file contains hidden or 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
var d = new dojo.Deferred(); | |
d.addErrback(function(){ | |
console.log('first error handler'); | |
}); | |
d.addErrback(function(){ | |
console.log('2nd error handler'); | |
}); |
This file contains hidden or 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
<html> | |
<head> | |
<title>Dojo Test Page</title> | |
<link rel='stylesheet' type='text/css' href='http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/resources/dojo.css'> | |
<link rel='stylesheet' type='text/css' href='http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css'> | |
<script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js'></script> | |
<script type="text/javascript"> | |
dojo.require('dijit._Widget'); |
This file contains hidden or 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> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Promise</title> | |
<script src="http://o.aolcdn.com/dojo/1.4/dojo/dojo.xd.js"> | |
</script> | |
<script type="text/javascript"> | |
dojo.provide("dojox.Promise"); |
This file contains hidden or 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
dojo.require('dojox.dtl'); | |
dojo.require("dojox.dtl.Context"); | |
dojo.addOnLoad(function(){ | |
var url = 'http://download.dojotoolkit.org/release-1.4.0/api.json'; | |
dojo.xhrGet({ | |
url: url, | |
handleAs: "json" | |
}).addCallback(function(data){ | |
var template = new dojox.dtl.Template( |
This file contains hidden or 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
var service = function(query, queryOptions){ | |
var dfd = new dojo.Deferred(); | |
var results = []; | |
// TODO: generate your results array here - it should look like your GET response | |
results = [ | |
{ | |
id: 'item1' | |
}, | |
{ |
This file contains hidden or 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
new dijit.form.ComboBox({ | |
store: new dojo.data.ItemFileReadStore({ | |
data: cityJson | |
}), | |
autoComplete: true, | |
query: { | |
state: "*" | |
}, | |
style: "width: 150px;", | |
required: true, |
This file contains hidden or 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 PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
<title>Untitled Document</title> | |
<style type="text/css"> | |
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.2/dojo/resources/dojo.css"; | |
</style> | |
<script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/dojo/1.2/dojo/dojo.xd.js' |
This file contains hidden or 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 PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
<title>Untitled Document</title> | |
<style type="text/css"> | |
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.2/dojo/resources/dojo.css"; | |
</style> | |
<script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/dojo/1.2/dojo/dojo.xd.js' |
This file contains hidden or 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
<script type="text/javascript"> | |
dojo.require("dojo.data.ItemFileWriteStore"); | |
var fillStore = function(){ | |
dojo.xhrGet({ | |
url: "some/url", | |
handleAs: "json", | |
load: function(data, ioArgs){ | |
// handle your data here | |
} |