Skip to content

Instantly share code, notes, and snippets.

@fredeerock
Created December 20, 2012 21:15
Show Gist options
  • Save fredeerock/4348647 to your computer and use it in GitHub Desktop.
Save fredeerock/4348647 to your computer and use it in GitHub Desktop.
load json file into javascipt
//http://stackoverflow.com/questions/2177548/load-json-into-variable
var json = (function () {
var json = null;
$.ajax({
'async': false,
'global': false,
'url': my_url,
'dataType': "json",
'success': function (data) {
json = data;
}
});
return json;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment