Wann?
Was macht:
function xyz() {
var checkResponse = null;
try {
var http = null;
if (window.XMLHttpRequest) {
http = new XMLHttpRequest();
} else if (window.ActiveXObject) {
http = new ActiveXObject("Microsoft.XMLHTTP");
}
if (http != null) {
http.open("GET", "example.html", true);
http.onreadystatechange = function () {
if (http.readyState == 4) {
checkResponse = http.responseText
;
alert(checkResponse);
}
}
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.send();
}
} catch(e) {
}
return checkResponse;
}
?