var somevar; $.ajax({ url: 'http://....', dataType: 'json', success: function(data) { somevar = data; } });