Do you remember how websites looked 3-4 years ago? There was no Ajax at all, maybe only some fancy useless HTML. Is it now better? In general, I think yes. But Ajax is often being a bit abused, and what’s worst people want Ajax in their web applications no matter why. This forces many web developers put ajax everywhere often without to consider several serious issues.
1. Ajax does not declare functions
2. IE caches GET requests
Internet Explorer knows how to cache the ajax response and is not afraid to do it. In fact it loves cache so much that you won’t be able to use the dynamic effect of Ajax call to the database if you send your request by GET. If your ajax calls the database, stupid IE keeps returning cached data even if you refresh the entire page.
Solution: Use POST calls. I know it’s slower, but how does it matter when GET does not work well?
3. Ajax does not upload files
If you have an ajax loaded page and you want to include a file upload field in it, I have “great” news for you: it does not work. What, is it not news? Poor you, you have already realized one of the ugliest limitations of ajax. Because of it, the developers need to all kind of gimmicks or use third party scripts with hidden iframes to make file upload works. That’s far away of web standards, user friendly code and search engines.
Hey, if all your users are geeks who browse with Firefox and like to poke config files, you can use this idea. Cool, eh?
4. Ajax causes memory leaks
5.Â How To Make Back/Forward Buttons Work On Ajax Page?
No, this is not a rhetorical question, I am really asking you how. Because I don’t know. Wait, I asked Google and he said this. Does it look simple to you?
Ajax Sucks For SEO
If all you care is to make fancy website, go ahead, use ajax everywhere. If you partner with popular websites or have big bucks for advertising, you’ll have no problems. What, do you say you are on a budget and hope to get visitors from the search engines? Forget either about Ajax or about Google.
Do you know more things that Ajax makes to help you look dumb? Go ahead, share them.
P.S. No, I am not saying don’t use ajax. I’m just pointing few things that suck.
Filed under: Technology Made Simple