Skip to content

Instantly share code, notes, and snippets.

@shazmoh
Created May 2, 2011 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shazmoh/952104 to your computer and use it in GitHub Desktop.
Save shazmoh/952104 to your computer and use it in GitHub Desktop.
JSFiddle Github Integration test using Dojo
#resultsContainer div {
padding: 2px;
margin: 3px;
border: 1px solid #ccc;
background-color: #efefef;
}
<div id="resultsContainer">loading...</div>
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);
});
});
});
name: jsFiddle/Gist integration
description: jsFiddle demo hosted on Gist using dojo.xhr() to load JSON data
authors:
- Shajahan Mohammed
normalize_css: no
[
{id: 1, name: "one"},
{id: 2, name: "two"},
{id: 3, name: "three"},
{id: 4, name: "four"},
{id: 5, name: "five"}
]
@shazmoh
Copy link
Author

shazmoh commented May 2, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment