$.ajax({ url: "xyGet.php", type: "POST", data: ({yget : 1}), dataType: "json", success: function(data){ MyCallback (data.y) } }); function MyCallback (coord) { alert(coord); }