Created
May 2, 2011 18:32
-
-
Save shazmoh/952104 to your computer and use it in GitHub Desktop.
JSFiddle Github Integration test using Dojo
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
#resultsContainer div { | |
padding: 2px; | |
margin: 3px; | |
border: 1px solid #ccc; | |
background-color: #efefef; | |
} |
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
<div id="resultsContainer">loading...</div> |
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.addOnLoad(function() { | |
var deferred = dojo.xhrPost({ | |
url: "/gh/gist/response.json/952104/", | |
handleAs: "json" | |
}); | |
dojo.when(deferred, function(results) { | |
var container = dojo.byId(resultsContainer); | |
dojo.empty(container); | |
dojo.forEach(results, function(item) { | |
dojo.create("div", { | |
innerHTML: item.id + " | " + item.name | |
}, container); | |
}); | |
}); | |
}); |
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
name: jsFiddle/Gist integration | |
description: jsFiddle demo hosted on Gist using dojo.xhr() to load JSON data | |
authors: | |
- Shajahan Mohammed | |
normalize_css: no |
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
[ | |
{id: 1, name: "one"}, | |
{id: 2, name: "two"}, | |
{id: 3, name: "three"}, | |
{id: 4, name: "four"}, | |
{id: 5, name: "five"} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://jsfiddle.net/gh/gist/dojo/1.6/952104/