Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-03-2007, 04:52 PM   PM User | #1
carlitos_way
New Coder

 
Join Date: Mar 2007
Location: italy
Posts: 94
Thanks: 1
Thanked 1 Time in 1 Post
carlitos_way is an unknown quantity at this point
IE response really slow

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

Code:
/*	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;
}
carlitos_way is offline   Reply With Quote
Old 07-05-2007, 04:34 PM   PM User | #2
wukfit
New to the CF scene

 
Join Date: Jul 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
wukfit is an unknown quantity at this point
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

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

Cheers,
WF
wukfit is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:13 PM.


Advertisement
Log in to turn off these ads.