- Multiple Ajax Requests are not fired in order:IE, breaking from a long tradition of ignoring independent standards, chooses to follow the HTTP 1.1 RFC 2616 to the letter, which means that IE may only have two XMLHttpRequests open at a time; after which IE will retain an internal queue of requests which will be serviced in no particular order. Even if the requests are fired in order, the nature of the internet dictates that they will not be received in order, so never write code that assumes XMLHttpRequests will be sent in a particular order. Firefox also has a similar albeit more liberal limitation in the number of simultaneous XMLHttpRequests that may be open; however in Firefox 1.5, the developer may modify the priority of the internal request queue.
- Asynchronous XMLHttpRequests responses will arrive in no particular order:As implied by the word Asynchronous, XMLHttpRequest responses may arrive at any time in an unpredictable order that is ignorant of developer intent, happily executing callbacks in the random order in which they eventually wind up on the client.
- XMLHttpRequest does not require the use of XML:While Ajax is aptly named when it comes to asynchronous execution, it is poorly named when it comes to XML. The XMLHttpRequest object has a useful method called responseText that delivers the straight text of the response, be it XML, JSON or just simple unadorned text. Using JSON or simple text can be much faster, easier, and more concise than XML
- Ajax uses UTF-8. :Normal forms are sent using the encoding of the parent page. Thus a SJIS encoded page will default to sending form content encoded in SJIS. Ajax submitted forms on the other hand will be sent as UTF-8. If for some strange reason, UTF-8 is not the character set of choice for the server, this will require a solution such as the server recognizing and translating UTF-8 responses to a desired character encoding
- Ajax requests are url encoded. : A bug relating to this can currently be seen on Digg.com. Submit a comment to digg, and then edit the comment to include a unicode character. The updated comment, sent via Ajax will be added to the database as the url encoded string: resulting in an odd looking url encoded comment.
Firefox quirks or bugs
- Synchronous XMLHttpRequests lock up Firefox. :The XMLHttpRequest method provides a third argument, which defines whether the Ajax requests are submitted synchronously or asynchronously. (xmlhttprequest.open(‘GET’, ‘http://www.mozilla.org/’, false);) On Firefox, setting this value to false will submit the xmlhttprequest synchronously and lock up the entire browser for the duration of the request.
IE quirks or bugs
- XMLHttpRequest Objects are not reused in IE. :Unless the abort method is used, XMLHttpRequest objects in IE won’t function after the first use, unlike in other browsers such as Firefox. One solution to this is to create a new XMLHttpRequest object for each connection. Some fear this causes memory leaks, but there seems to be no conclusive proof of this as long as the known closures memory leak issue is avoided (detailed later).
- Avoiding aggressive caching in IE :Even with proper ‘no-cache’ headers, IE caches ‘GET’ requests – this can be solved by changing the get request query string with every request.An alternative solution for this is to use “If-Modified-Since” request header to point to some past date using xhr.setRequestHeader(“If-Modified-Since”,”some past date”); If you can’t modify the query string, this is a workaround that will stop IE from caching too aggressively