Connecting Tech Pros Worldwide Forums | Help | Site Map

XMLHttpRequest in IE7

Newbie
 
Join Date: Feb 2007
Posts: 6
#1: Feb 26 '07
i am working with XMLHttpRequest.

it is supporting in both IE6,IE7 and mozilla in localhost

But when it comes to site after hosting it doesn't in IE7.
but XMLHttpRequest does in IE6 and Mozilla.

Does any one can help me with this.

Thanking you in advance.
Vinod

dorinbogdan's Avatar
Expert
 
Join Date: Feb 2007
Posts: 822
#2: Feb 26 '07

re: XMLHttpRequest in IE7


Quote:

Originally Posted by vinodkreddy1

But when it comes to site after hosting it doesn't in IE7.

It may require some security settings? By default IE7 is more restrictive.
Newbie
 
Join Date: Feb 2007
Location: Alabama, USA
Posts: 19
#3: Feb 27 '07

re: XMLHttpRequest in IE7


Are you working with XML? If so, is it being served as "text/xml"?
Expert
 
Join Date: Oct 2006
Location: NC
Posts: 1,722
#4: Feb 27 '07

re: XMLHttpRequest in IE7


Quote:

Originally Posted by vinodkreddy1

i am working with XMLHttpRequest.

it is supporting in both IE6,IE7 and mozilla in localhost

But when it comes to site after hosting it doesn't in IE7.
but XMLHttpRequest does in IE6 and Mozilla.

Does any one can help me with this.

Thanking you in advance.
Vinod

Please post the code so we can see what is going on with the problem.
Newbie
 
Join Date: Feb 2007
Posts: 6
#5: Feb 27 '07

re: XMLHttpRequest in IE7


Quote:

Originally Posted by AricC

Please post the code so we can see what is going on with the problem.


my application when Country dropdown is selected the state and city drop down should be filled..

i am using this by callback.

my code is ..

if (window.XMLHttpRequest)
{
var xmlRequest = new XMLHttpRequest();
postData = __theFormPostData +
"__SCRIPTCALLBACKID=" + eventTarget +
"&_ScriptcallType=" + callType +
"&__SCRIPTCALLBACKPARAM=" + escape(eventArgument + "$" + callType).replace(re, "%2B");

if (pageUrl.indexOf("?") != -1)
{
xmlRequest.open("GET", pageUrl + "&" + postData, false);
}
else
{
xmlRequest.open("GET", pageUrl + "?" + postData, false);
}
xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlRequest.send(null);
try
{
response = xmlRequest.responseText;
status = xmlRequest.getResponseHeader("__SCRIPTCALLBACKSTAT US");

if (status == "200")
{
ShowResponse(response, context);
}
else
{
ShowErrorResponse(response, context);
}
else
{
var xmlRequest = new XMLHttpRequest();

xmlRequest.onreadystatechange = WebForm_OnClientCallbackComplete;

var __callbackObject = new Object();
__callbackObject.xmlRequest = xmlRequest;
__callbackObject.eventTarget = eventTarget;
__callbackObject.eventArgument = eventArgument;
__callbackObject.context = context;

addToCallbackList(__callbackObject);

postData = __theFormPostData +
"__SCRIPTCALLBACKID=" + eventTarget +
"&_ScriptcallType=" + callType +
"&__SCRIPTCALLBACKPARAM=" + escape(eventArgument + "$" + callType).replace(re, "%2B");

if (pageUrl.indexOf("?") != -1)
{
xmlRequest.open("GET", pageUrl + "&" + postData, false);
}
else
{
xmlRequest.open("GET", pageUrl + "?" + postData, false);
}
xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlRequest.send(null);
}

}
dorinbogdan's Avatar
Expert
 
Join Date: Feb 2007
Posts: 822
#6: Feb 27 '07

re: XMLHttpRequest in IE7


I would try also the classic method of creating the XMLHTTP object:
[HTML]var xmlRequest;
try
{ // Firefox, Opera 8.0+, Safari
xmlRequest=new XMLHttpRequest();
}
catch (e)
{ // Internet Explorer
try
{
xmlRequest=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlRequest=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
[/HTML]
Newbie
 
Join Date: Mar 2007
Posts: 1
#7: Mar 5 '07

re: XMLHttpRequest in IE7


I may have the same problem. FF2 and IE6 both work, but IE7 does not. I looked at the network using wireshark. The XML request goes to the server, and the response comes back, but the response field is empty. I'm using prototype.js as the basis for the script.
Reply