Skip to content

Instantly share code, notes, and snippets.

@neonstalwart
Created September 16, 2009 01:51
Show Gist options
  • Save neonstalwart/187807 to your computer and use it in GitHub Desktop.
Save neonstalwart/187807 to your computer and use it in GitHub Desktop.
<!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