Endeavor88
11-12-2005, 12:14 PM
Out of fun, I recently made a blog at blogger.com. Being curious, I tried to implement a xmlhttprequest into the blog's template. The function below works perfectly until it reaches the req.open() function. I have tried this same script on my own web server and it works perfectly. Does blogger not allow xmlhttprequests??
function loadXMLDoc(url) {
req = false;
// branch for native XMLHttpRequest Object
// Safari and Mozilla
if(window.XMLHttpRequest) {
try {
req = new XMLHttpRequest();
} catch(e) {
req = false;
}
// branch for IE/Windows ActiveX version
} else if(window.ActiveXObject) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
req = false;
}
}
}
if(req) {
req.onreadystatechange = processReqChange;
alert('hello, '+url);
req.open("GET", url, true); // true = act asynchronously (don't wait for server response)
alert('hello, '+url);
req.send("");
}
}
function loadXMLDoc(url) {
req = false;
// branch for native XMLHttpRequest Object
// Safari and Mozilla
if(window.XMLHttpRequest) {
try {
req = new XMLHttpRequest();
} catch(e) {
req = false;
}
// branch for IE/Windows ActiveX version
} else if(window.ActiveXObject) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
req = false;
}
}
}
if(req) {
req.onreadystatechange = processReqChange;
alert('hello, '+url);
req.open("GET", url, true); // true = act asynchronously (don't wait for server response)
alert('hello, '+url);
req.send("");
}
}