This jQuery.getJSON works for me in Safari, but not FF or Chrome. In Safari, I get alerts with json name/value pairs. In FF/Chrome. I get the 3 error alerts (all returning empty strings). Any ideas what I'm doing wrong here?
<!-- language: javascript -->
$.ajaxSetup({"error":function(XMLHttpRequest,textStatus, errorThrown) {
alert("text Status: " + textStatus);
alert("error thrown: " + errorThrown);
alert("response:" + XMLHttpRequest.responseText);
}});
$.getJSON("http://example.com/webservice",
{
},
function(data) {
for(var key in data){
var attrName = key;
var attrValue = data[key];
alert('name='+ attrName + ' value=' +attrValue);
}
});