$.ajax({ type: "GET", url: url, dataType: "json", async: false, success: function(json, textStatus){ //doing }, error: function (xhr, err) { alert("readyState: " + xhr.readyState + " status: " + xhr.status); alert("responseText: " + xhr.responseText); } });