I am trying to patch up a bit of AJAX that doesn't work in Chrome. It's not my script and I'd rather not convert the whole thing to jQuery.
xmlhttp.open("GET", query, true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
console.log(xmlhttp.responseText);
}
}
xmlhttp.send();
This actually outputs something in the log while using Internet Explorer, but when in (Ch)rome I get an empty string, since the JS debugger tells me that GET
failed. The target URL is correct since it works in IE, but it is some kind of ASP.NET script which inner workings I'm not very familiar with (I do the HTML, CSS and JavaScript around here).
Why could it be that IE is allowed to retrieve the information from the target, but not Chrome? When using Chrome xmlhttp
is a XMLHttpRequest
and IE gets some kind of ActiveXObject
.
Edit. I found some possible solutions here. Response.Close()
, no async or specified/empty data type. It's jQuery though.