...

View Full Version : IE response really slow



carlitos_way
07-03-2007, 04:52 PM
Hi all, i'm working on an AJAX project that, when i use FF, is really fast, while when using IE is really slow.
these are my connection parameters: can you tell me if i can optimize them in any way, or if i'm doing something wrong? Thanks :)


/* AJAX */
var http_request = false;

function makePOSTRequest(url, parameters) {
http_request = false;

if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
// set type accordingly to anticipated content type
//http_request.overrideMimeType('text/xml');
http_request.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}

if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}

http_request.open('POST', url, true);
http_request.onreadystatechange = alertContents;
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("Connection", "close");
http_request.send(parameters);
return false;
}

wukfit
07-05-2007, 04:34 PM
Hi,
The only 2 officially supported progids are MSXML2.XMLHTTP.3.0 and MSXML2.XMLHTTP.6.0 (although I fall back to Microsoft.XMLHTTP if the other two aren't available) - Using the right version of msxml (http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx)

You might want to try that first... let me know.

Cheers,
WF



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum