It turns out that IE doesn't like JSON encoded documents that are specified as UTF-8. Not sure what the problem is, but the document has to be returned in a format IE likes. If not, IE will not allow jQuery to process it. Now, I had a header on this file that specified the content-type and charset. But, I changed it and instead I put only the content-type at the top of my JSON-returning PHP files:
<?PHP
header("Content-Type: application/json");
?>
Why does IE balk at UTF-8 specified charsets for JSON-encoded responses?? Who knows. But, from the research I've done, specifying the charset in the HTTP header is not something that is required. I am sure there are good reasons to specify the charset, but this (above) works great for me.
6 comments:
Man, u save my life, tnx!!
Thanks so much for taking the time to post this, you saved me many hours!
Maybe its time for a class action lawsuit against M$ for all the hours programmers around the world lost due their software not being standards compliant!
No problem.
I just don't get why they would create a browser that doesn't accept UTF-8 AJAX queries. UTF-8 should be the norm!
Nice. Did the trick.
Hi,
Thanks for your post. I've being wrestling with this a lot.
And I am still...
The content does not get loaded in the first page load, it loads if I refresh the page.
Well, before your suggestion IE did nothing....
I hate IE...
Thank you, the solution actually works for me, unlike the others I've found over the Internet.
Post a Comment