PDA

View Full Version : Problems with pure AJAX?


mlse
03-28-2008, 01:30 PM
Hi all,

I am using more and more AJAX in the websites that I build. I wonder what, if any, are the drawbacks of using AJAX as compared to the standard HTTP submit/response method.

Stooshie
03-28-2008, 03:30 PM
Accessibility is one drawback. Screen readers are not very good at reading content that is dynamically created by client side scripts.

You can make ajax that degrades gracefully but it can be a lot of work, particularly if you are writing something more along the lines of an online application.

Basscyst
04-01-2008, 09:32 PM
It also breaks the back button, in that if you are using ajax to retrieve all your content, your page will not save state and the user's expected history can become misleading.

mlse
04-02-2008, 11:33 AM
Yep, I absolutely *HATE* that with a passion when I encounter it! Especially when I trawl a site for a good half hour or more, eventually find the page I want, fail to notice that the URL hasn't changed, smugly hit CTRL+D - then when I visit the bookmark later - hey presto! ... The homepage of the site. :mad: (much purple-faced swearing, flying coffee cups, etc ...)

I have a rule for my AJAX - use it to modify existing page content (e.g. highlight a password input and generate a javascript alert when the user has entered the wrong password) but if page content needs to be modified a lot (e.g. change of page) then I use the standard HTTP request mechanism to request a fresh page from the server.

A1ien51
04-03-2008, 02:05 AM
You could use something like Really SImple History for back button support: http://code.google.com/p/reallysimplehistory/

HTML5 has new tags to also help with this too: http://blogs.pathf.com/agileajax/2008/03/ie8-html5-and-a.html

Eric