AJAX cons and limits

When I’ve decided to use AJAX in my framework, I’ve had a lot to do to enable AJAX requests and responses, and actually, a very shiny result I’ve got, that is, I’ve used it and built multiple websites for internal and external networks, and also for the internet, before I faced the truth and realized the trouble I fell in.

AJAX Technology

Here are some of limits I’ve faced when relying on AJAX:

  1. You can’t make any file upload or download using just AJAX, instead, many programmers used to add a hidden frame to their web page called HiddenFrame or something similar, and then they target requests of uploading and downloading as normal browser HTTP request to that frame, so they aren’t using AJAX, but for the visitor, it seems to be.
    Limitation on this solution is you can’t deal with other elements on your visible page using javaScript if you didn’t use the parent object to access. Of course you should use the name of the frame if you decided to use the frameset instead of the inline frame (Frameset has been removed fro HTML5)
    I’ve read an article by a programmer who wanted to write a javascript code to read the file as text stream and send it as sequential peaces. I don’t think it will work, and didn’t check for it again.
  2. The multilingual websites will cause some confusion to AJAX programmer while you should receive the text and then find the original charset to translate that text into. Actually, I’ve used a class I’ve found on PHPClasses and written by Khaled AlShamaa to work around this problem.
  3. The main problem of AJAX which you will not realize until you publish your site to the internet is that search engines will not be able to find results in your website without an advanced modifications you should make to your site.
    Actually, you will see this problem a monster which wants to destroy your work when you completely rely on AJAX to navigate from page to other so no link on your pages will start a browser HTTP request/response cycle and will result a complete HTML web page.
    To solve this problem, either I used the meta tag to add keywords from the database all to one page, or, I wrote a dynamic page that generates HTML links to real auto-generated HTML pages which contain auto AJAX request to the real content.
    Search engines would help in solving this problem if they can read AJAX request links and interpret the XML resulted by the request.
  4. What if someone who hates JavaScript or concerns about his confidentiality and security disabled all PlugIns, AddOns, Scripts in his browser? Don’t you think your website would work as disabled person?
  5. Your website will not work on almost all mobiles on the globe.
  6. Debugging is too complicated in AJAX compared to the normal Web Applications.

I am not saying: lets drop AJAX down and reverse back to the normal web applications or use flash technologies instead, it is just an invitation to reconsider all these elements before deciding to use AJAX in most of your application flow.

And I think just to be fair, here I’m listing some of benefits you gain using AJAX:

  1. quicker application flow
  2. desktop-like web application
  3. higher interactivity with visitor
  4. richer client interface (also requires more powerful hardware)
  5. smaller page size
  6. invisible two-direction feedBack
  7. Lighter load on network
  8. … more and more …
One Comment

Leave a Reply