What are the things to consider and watch out for when designing a website with AJAX? Must take care of conditions, say timeouts, error handling, for instance?
Best practices? What parameters to take care of while designing and coding?
What are the things to consider and watch out for when designing a website with AJAX? Must take care of conditions, say timeouts, error handling, for instance?
Best practices? What parameters to take care of while designing and coding?
Maintaining usability for users without JavaScript enabled, also known as "progressive enhancement".
I assume this will probably become a collaboration of tips so here is one from my experience.
One gotcha I have found when working with AJAX and Internet Explorer is that IE sometimes likes to cache the response for your requests. So if you find that requests are working in Firefox but not IE this could be the culprit.
The solution, simple add an additional parameter to your request URL that will in most cases be completely irrelevant. The parameter can be whatever you want, but the value needs to be ever changing and always different, best solution I have found is to use a date/time stamp since time is always incrementing. For the visual learner here is an example.
Normal request
http://example.com/controller/action?query=john
Requests to work with IE
First request
http://example.com/controller/action?query=john&seed=1234567890
Second request
http://example.com/controller/action?query=john&seed=2345678901
The reason this works is because IE sees it as a new URI that it has never grabbed before so there is nothing in the cache for it.
There's a few different views to consider:
Dependancies
API / Interface Design
Security
Documentation