Created
September 16, 2009 01:51
-
-
Save neonstalwart/187807 to your computer and use it in GitHub Desktop.
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' | |
djConfig="parseOnLoad: true, isDebug: false"></script> | |
<script type="text/javascript"> | |
dojo.require("dojo.data.ItemFileWriteStore"); | |
dojo.addOnLoad(function(){ | |
var store; | |
dojo.xhrGet({ | |
url: 'countries.json', | |
handleAs: 'json', | |
load: function(response, request){ | |
store = new dojo.data.ItemFileWriteStore({ | |
data: response | |
}); | |
return response; | |
} | |
}); | |
logStore = function(){ | |
store.fetch({ | |
onItem: console.log | |
}); | |
}; | |
}); | |
</script> | |
</head> | |
<body class="tundra"> | |
<button onclick='logStore();'>log store</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment