Skip to content

Instantly share code, notes, and snippets.

@sakti
Created August 4, 2011 03:02
Show Gist options
  • Save sakti/1124415 to your computer and use it in GitHub Desktop.
Save sakti/1124415 to your computer and use it in GitHub Desktop.
ajax get data synchronous
var getDataSync = function(url){
var result;
$.ajax({
async:false,
url:url,
type:'GET',
dataType:'json',
success:function(data){
result=data;
}
});
return result;
}
// example
// var data = getDataSync('http://localhost/getlistcolumn');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment