Posts Tagged ‘ajax’

Firefox 3 XMLHttpRequest Bug

Tuesday, July 15th, 2008

This one slipped right through the cracks.

We had a pretty big product go down for a coupple weeks due to this guy. In short, when Firefox 3 makes AJAX requests (XMLHttpRequest) and uses createDocument(), it sets the default character encoding to ISO-8859-1.

Which is fine, except for when you’ve got old, fragile code running that relies on its files to be in UTF-8. Then Firefox chokes, the XML file is returned as blank, and then pages show up empty. “No element found” errors popped up in many circumstances.

There’s a hackish JavaScript fix, though its reportedly ‘10x slower.’ The best thing to do is check and clean things on the server side.

Check out the Bugzilla entry, and Encoding issue with XMLHttpRequest and Firefox 3 for a PHP function to clean up your encoding headers.