function json (url){
$.getJSON(url, function(data) {
return data;
})
}
this function don't see "data"
function MakeAlert(){
data = json('action.php');
window.alert(data.name);
}
this work:
function json (url){
$.getJSON(url, function(data) {
window.alert(data.name);
})
}