IE6 AJAX Response Data Issue
I've been looking all over and i can't find anything to fix this problem.
IE6 only is having an issue with the response of an AJAX call and is erroring because of invalid data (alerting the data shows a single beauitful weird square)
Locally IE6 works perfectly (same page and same data), i've checked and rechecked its calling the correct URL's on the server vs here and its not cross domain or anything like that. It's also actually making the call fine and getting a response (OK status)
Calling the AJAX url on the live server in IE6 via address bar works perfectly and shows all the data fine too.
I've tried forcing the content-type and charset, i've tried turning off compression in the web.config and its still dead... and i开发者_高级运维'm running out of time :(
FF3.5, IE7, IE8 all perfectly fine locally and on the server. Server is Windows 2008 (Rackspace Cloud) and local is just the built-in dev server from Web Dev Express 2008
Its a MVC C# App.. any ideas would be appreciated!
EDIT:
Not alot i can paste but ok, controller:
public ActionResult TEST()
{
return Content("HI THERE!", "text/plain");
}
it was text/html of course to start with.
The javascript is a simple ajaxURL function which loads XMLHttpRequest or MSXML2.XMLHTTP or Microsoft.XMLHTTP. on ready state change, if the readyState == 4 then alert the result and its a square (unless you load the url in the browser directly)
Again the entire site loads fine in all other browsers so i think its more a server/config issue esp as even IE6 works locally. I've made the ajax URL's fully referenced just in case (using code to get host, checking non default port and adding it for localhost etc etc)
Viewing source all the calls to ajaxURL are perfect... i'll try another encoding option other than UTF-8 perhaps and check more compression options.
Surely i'm not the only one to ever come across this? heh
Found the issue, putting here in case others need the info :)
Content-Encoding: gzip
This is killing my IE6 ajax calls, i just need to get it turned off on the host. It also explains why it works locally without returning garbage as gzip isn't set locally.
Now i have to find out why the web.config HttpCompression settings arn't affecting it being compressed
EDIT:
<urlCompression doDynamicCompression="false" doStaticCompression="false"></urlCompression>
This did it, IE6 ajax working server side nicely again, 2:30am now i can go to bed! :D
Anyone having a similar issue with IE6 and responseText where responseText is a weird square looking character... it's the same problem! Just found this out after hours of searching.
Solution is to send your response with no Content-Encoding. In PHP for example, use the following header: header('Content-Encoding: none');
Thanks to White Dragon for finally solving this for me.
I've been experiencing the same sort of problems and discovered that the problems only existed when using IE6 in IETester. When testing on a separate workstation IE6-XP-SP2 the AJAX responses were fine.
I have the same problem, too. But I try White Dragon's, it doesn't work! And I found that the data that ajax many times is the same, so I think is about the request cache. I set it to no-cache, then I solve the problem.
精彩评论