How NOT To Use AJAX

AJAX. It is an awesome technology ushering in a whole new generation of web applications like Google maps, Backpack and others. But AJAX can also be a very dangerous technology for those who use it improperly.

For this reason, I’ve compiled a list of the many common mistakes developers using AJAX sometimes make. Javascript itself is sort of a ‘clunky’ and dangerous interface technology, but I tried my best to keep this list centered on AJAX techniques. Keep reading for the list.

Using AJAX Because Everyone Else Is

Sure AJAX is cool, and developers love to play with cool technology, but AJAX is a tool, not a toy. A lot of AJAX isn’t seriously needed to improve usability but rather experiments in what AJAX can do or trying to fit AJAX somewhere where it isn’t needed.

Taking Away The Back Button

The back button is a great feature of the standard web site user interface. Unfortunately, the back button doesn’t mesh very well with Javascript. Keeping back button functionality is one reason not to go with a pure Javascript web app.

Keep in mind however that good web design provides the user with everything they would need to successfully navigate your site, and never relies on web browser controls.

Not Telling The User Where To Click

If something I’m clicking on is triggering AJAX actions, you have to give me a visual cue that something is going on. An example of this is Gmail loading button that is in the top right. Whenever I do something in Gmail, a little red box in the top right indicates that the page is loading, to make up for the fact that AJAX doesn’t trigger the normal web UI for new page loading.

Leaving The Lesser Ones Behind

As web applications push the boundaries further and further, it becomes more and more compelling to move all applications to the web. The provisioning is better, the world-wide access model is great, the maintenance and configuration is really cool, the user interface learning curve is short.

However, with this new breed of AJAX applications, people who have spotty internet connections or people who just don’t want to switch to the web need to be accommodated as well. Just because technology ‘advances’ doesn’t mean that people are ready and willing to go with it. Web application design should at least consider offline access. With GMail it’s POP, Backpackit has SMS integration. In the Enterprise, it’s web-services.

Don’t Take Out The “A”

With tabbed browsers, I can manage various waits at websites, and typically I only have to wait for a page navigation. With AJAX apps combined with poor network connectivity/bandwidth/latency I can have a really terrible time managing an interface, because every time I do something I have to wait for the server to return a response. However, remember that the ‘A’ in AJAX stands for ‘Asynchronous’, and the interaction can be designed so that the user is not prevented from continuing to work on the page while the earlier request is processed.

Encrypt That Data!

The security of AJAX applications is subject to the same rules as any web application, except that once you can talk asynchronously to the server, you may tend to write code that is very chatty in a potentially insecure way. All traffic must be vetted to make sure security is not compromised.

Forgetting About The Big Boys

AJAX development is multi-platform development. As nerds and coders, many developers forget that not everyone has a tricked-out installation of Firefox to test their apps on. AJAX code will run on IE’s javascript engine, Spidermonkey (Mozilla’s js engine), Rhino (a Java js implementation, also from Mozilla), or other minor engines that may grow into major engines. So it’s not enough just to code to JavaScript standards, there needs to be real-world thorough testing as well. A major obstacle in any serious Javascript development is IE’s buggy JS implementation, although there are tools to help with IE JS development.

Not Considering The Other Users

In the case of developing an Intranet type web application, you have to remember that you might have more than one person using the application at once. If the data that is being displayed is dynamically stored in a database, make sure it doesn’t go “stale” on you.

Overwhelming The Browser

AJAX introduces a way to make much more interesting javascript applications, unfortunately interesting often means more code running. More code running means more work for the browser, which means that for some javascript intensive websites, especially inefficiently coded ones, you need to have a powerful CPU to keep the functionality zippy. The CPU problem has actually been a limit on javascript functionality in the past, and just because computers have gotten faster doesn’t mean the problem has disappeared.

What About The Sidekick Browsers?

According to the W3 schools browser usage statistics, which if anything are skewed towards advanced browsers, 11% of all visitors don’t have JavaScript. So if your web application is wholly dependent on JavaScript, it would seem that you have potentially cut a tenth of your audience.

Please God, No Dancing Jesusii

The first A in AJAX stands for asynchronous. The problem with asynchronous messages is that they can be quite confusing when they pop in unexpectedly. Asynchronous page changes should only ever occur in narrowly defined places and should be used judiciously, flashing and blinking in messages in areas I don’t want to concentrate on harkens back to days of the html blink tag. “Yellow Fade”, “One Second Spotlight” and other similar techniques are used to indicate page changes unobtrusively.

Destroying The Ability To Hyperlkink

Another great feature of websites is that I can pass URLs to other people and they can see the same thing that I’m seeing. I can also bookmark an index into my site navigation and come back to it later. Javascript, and thus AJAX applications, can cause huge problems for this model of use. Since the Javascript is dynamically generating the page instead of the server, the URL is cut out of the loop and can no longer be used as an index into navigation. This is a very unfortunate feature to lose, many AJAX web apps thoughtfully include specially constructed permalinks for this exact reason.

Blocking The Googlebot

AJAX applications that load large amounts of text without a reload can cause a big problem for search engines. This goes back to the URL problem. If users can come in through search engines, the text of the application needs to be somewhat static so that the spiders can read it.

Using Too Many AJAX Requests At Once

Sure with AJAX you can make edits to a lot of form fields happen immediately, but that can cause a lot of problems. For example if I check off a lot of check boxes that are each sent asynchronously to the server, I lose my ability to keep track of the overall state of checkbox changes and the flood of checkbox change indications will be annoying and disconcerting.

Hey! Where’d My Place Go?

Another problem with popping text into a running page is that it can effect the page scroll. I may be happily reading an article or paging through a long list, and an asynchronous javascript request will decide to cut out a paragraph way above where I’m reading, cutting my reading flow off. This is obviously annoying and it wastes my time trying to figure out my place. But then again, that would be a very stupid way to program a page, with or without AJAX.

So Wait, I Click This Spinning Wheel, Then What Happens?

A major mistake that is easy to make with AJAX is: ‘click on this non obvious thing to drive this other non obvious result’. Sure, users who use an application for a while may learn that if you click and hold down the mouse on this div that you can then drag it and permanently move it to this other place, but since it’s not in the common user experience, you increase the time and difficulty of learning the application, which is a major negative for any application. On the plus side, intuitiveness is a function of learning, and AJAX is popularizing many new conventions which will become intuitive as time goes by. The net result will be greater productivity once the industry gets over the intuitiveness hump.

Character Encoding

One big problem with using AJAX is the lack of support for character sets. You should always set the content character set on the server-side as well as encoding any data sent by Javascript. Use ISO-8859-1 if you use plain english, or UTF-8 if you use special characters, like æ, ø and å (danish special characters) Note: it is usually a good idea to go with utf-8 nowadays as it supports many languages).

GET Your Hands Off My POSTs

The majority of AJAX applications tend to just use the GET method when working with AJAX. However, the W3C standards state that GET should only be used for retrieving data, and POST should only be used for setting data. Although there might be no noticeable difference to the end user, these standards should still be followed to avoid problems with robots or programs such as Google Web Accelerator.

Use Your Functions Wisely, And Don’t Confuse Your User

Since AJAX/Javascript gives you such specific control over page content, it’s easy to get too focused on a single area of content and miss the overall integrated picture. An example of this is the Backpackit title. If you change a Backpackit page title, they immediately replace the title, they even remember to replace the title on the right, but they don’t replace the head title tag with the new page title. With AJAX you have to think about the whole picture even with localized changes.

Error Reporting

In a traditional server-side application, you have visibility into every exception, you can log all interesting events and benchmarks, and you can even record and view (if you wish) the actual HTML that the browser is rendering. With client-side applications, you may have no idea that something has gone wrong if you don’t know how to code and log exceptions from the remotely called pages to your database.

Watch Out, You Could Be Hurting More Than Helping

Sometimes AJAX can impressively improve the usability of an application (a great example is the star-rating feedback on Netflix), but more often you see examples of expensive rich-client applications that were no better than the plain HTML versions.

This One Is Just Plain Annoying

One example of this is blinklist and their AJAX paging mechanism on the front page. As you click to see another page of links, ajax fills in the next page. Except that if you are used to a browser experience, you probably expect to go to the top of the page when you hit next page, something JavaScript driven page navigation doesn’t do. BlinkList actually anticipates this and tries to counteract by manipulating your scrolling to scroll upwards until you hit the top. Except this can be slow and if you try scrolling down you will fight the upwards scrolling JavaScript and it won’t let you scroll down. But then again, that is very stupid way to program a page, with or without AJAX.

Just A Tool

It seems everyone has forgotten that AJAX is just another tool in the toolbox for Web Design. You can use it or not and misuse it or not. The old 80/20 rule always applies to applications (if you cover 80% of what all users want/need then you have a viable app) and if you lose 11% of your audience because they don’t switch on their javascript then you have to ask yourself if changing your app is worth capturing that 11% or stick with 89% that are currently using it and move on to something else. Also web apps should take advantage of all tricks to enable them to function quickly and efficiently. If that means using javascript for some part, AJAX for another and ASP callbacks for a third, so be it.

Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • Reddit
  • Furl
  • NewsVine
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • De.lirio.us
  • Fark
  • feedmelinks
  • LinkaGoGo
  • Ma.gnolia
  • Netvouz
  • RawSugar
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

67 Comments to “How NOT To Use AJAX”  

  1. 1 threz

    Regarding POST vs GET, browsers sometimes issue more than one GET request from a single XMLHttpRequest.
    So that means bad things (duplicate entries etc.) can happen if you do use GET to write data.

  2. 2 0ist

    With respect to ‘Taking Away The Back Button’ and ‘Destroying The Ability To Hyperlink’ there are frameworks that handle this for you (dojotoolkit.org among others). However it may be difficult to implement when handling several AJAX requests.

    I have to agree with your conclusion about using AJAX because everyone else is. One should only use it when the application really requires, e.g. to improve speed and user functionality.

  3. 3 Douglas Karr

    This is a good run-down. Respectfully, I would say that many of these issues are usability and human-computer interface design… not necessarily ajax issues. As well, things like data encryption are only necessary if you’re passing data you wish to keep secure. There are tons of opportunities where it’s unnecessary to keep the data secure.

    Regards,
    Doug

  4. 4 Amol Sonawane

    really very useful for ajax development…to avoid the things that not be done

  5. 5 jim

    Watch True Blood -http://www.tvport.net/sub_categories/6/True-Blood

  6. 6 Tivo Premiere

    I was looking for dvr related articles, this was great - bookmarked your site!

  7. 7 eiwsuaiyae

    I can’t read migraineheartahe.ccom in IE 5.3, juyst fgiued I might tell you about it.

    videose onlien

  8. 8 Gaston Preda

    Electronic cigarette smokers like the mental image of smoking. The motivation may be inspired close to the savour of the nicotine or the sawbones play of having an.

  9. 9 Nguyet Glomski

    going through this blog, its my sincere feeling that you own the exact idea of what are you deliberating.I really want to applaud you for zeal for the work you own that has made you stand today at this stage.Genuinely,there has not been even once that I have visited your post and went without getting some good knowledge.Keep it up.

  10. 10 nicki minaj naked

    I GOT A CRAZY IDEA FOR U, DONT DO IT ” lmaooo !!!!!

  11. 11 Irish Sweadner

    17. Thank you for the good writeup. It in fact was a amusement account it. Look advanced to more added agreeable from you! However, how could we communicate?

  12. 12 Whey Gold Standard

    The following time I learn a blog, I hope that it doesnt disappoint me as much as this one. I imply, I know it was my option to learn, but I truly thought youd have something interesting to say. All I hear is a bunch of whining about something that you may fix if you werent too busy on the lookout for attention.

  13. 13 opt in

    I do not even know how I finished up here, but I believed this post used to be good. I don’t recognise who you are but certainly you’re going to a well-known blogger in the event you aren’t already ;) Cheers!

  14. 14 joseph
  15. 15 Elizabeth

    Such superb analysis! I have no clue how you managed to write this text..it’d take me weeks. Well worth it though, I’d assume. Have you considered selling banners on your blog?

  16. 16 Izhar

    I adore your wp theme, exactly where would you get a hold of it through?

  17. 17 BG mail

    I like what you guys are up too. Such smart work and reporting! Carry on the superb works guys I have incorporated you guys to my blogroll. I think it will improve the value of my web site :).

  18. 18 birthdays

    I was just looking for this information for some time. After six hours of continuous Googleing, at last I got it in your site. I wonder what is the lack of Google strategy that do not rank this type of informative websites in top of the list. Usually the top sites are full of garbage.

  19. 19 guitar keychain

    Good site! I really love how it is simple on my eyes and the data are well written. I am wondering how I could be notified when a new post has been made. I have subscribed to your RSS feed which must do the trick! Have a nice day!

  20. 20 Diablo 3 Demos

    I will right away snatch your rss feed as I can’t to find your email subscription link or newsletter service. Do you have any? Kindly let me recognise in order that I could subscribe. Thanks.

  21. 21 Car Rental Comparison

    It is best to take part in a contest for top-of-the-line blogs on the web. I’ll suggest this site!

  22. 22 MovieReview

    I used to be more than happy to search out this net-site.I wanted to thanks for your time for this wonderful read!! I positively having fun with each little bit of it and I have you bookmarked to take a look at new stuff you weblog post.

  23. 23 cugoiuj@gmail.com

    Hey there, This document is rather educational and fun to read. I am a huge follower in the points blogged about. I also love reading the comments, but it looks as a great deal of readers need to stay on topic to try and add one thing towards original topic. I would also encourage all of you to bookmark this page for the most employed service to aid get the word out. Thanks

  24. 24 riproduzione orologi

    very good publish, i actually love this website, keep on it. copie orologi

  25. 25 Gerard Teal

    I’ve visited many blogs,forums, but this time:How your fantastic forum is . It makes me surprise….

  26. 26 Free Classified Ads UK

    My wife and i have been now delighted when Raymond managed to conclude his investigations via the precious recommendations he was given while using the site. It is now and again perplexing just to happen to be handing out key points that many many people have been making money from. And we also discover we now have the website owner to appreciate for this. All of the illustrations you have made, the straightforward site menu, the relationships your site make it easier to foster - it is most wonderful, and it’s letting our son and our family do think this issue is satisfying, and that is rather pressing. Many thanks for the whole thing!

  27. 27 elgoog

    I am pleased that I discovered this blog, just the right info that I was looking for!

  28. 28 Heidi Hepp

    Good day I am so grateful I found your blog. A quick question if you don’t mind. I’m really enjoying the design and layout of your site. It’s a very easy on the eyes which makes it easy to follow for me to come here and visit more often. Did you hire out a designer to create your theme? Superb work!…

  29. 29 rv repair

    Howdy! I just would like to give an enormous thumbs up for the good info you might have here on this post. I might be coming again to your blog for extra soon.

  30. 30 economia

    My husband and i got really cheerful that Peter managed to conclude his inquiry using the ideas he got through your weblog. It is now and again perplexing to simply always be making a gift of thoughts people might have been making money from. And we also remember we now have the blog owner to be grateful to for this. The most important explanations you have made, the simple site navigation, the friendships you will make it easier to foster - it’s got everything awesome, and it is assisting our son and our family do think that situation is enjoyable, which is certainly tremendously serious. Thanks for all the pieces!

  31. 31 informatica toledo, componentes pc, tienda informatica toledo

    Hola, elegante post, sigue lanzando nuevos posts porque desde hoy mismo ya posees un nuevo y curioso suscriptor.

  32. 32 boxing gloves

    Hello, Simply just desire to assert ones own write-up is as a revelation. This readability on your content is superb and additionally possible presume you can be a consultant for this area. for details on boxing and fitness equipments services contact us.

  33. 33 Call India Cheap

    I have been absent for some time, but now I remember why I used to love this website. Thanks, I will try and check back more often. How frequently you update your website?

  34. 34 arcopedico

    Aw, this was a really nice post. In concept I would like to put in writing like this additionally – taking time and actual effort to make an excellent article… but what can I say… I procrastinate alot and not at all appear to get one thing done.

  35. 35 Michael Wallace

    Hey there mate! I just figured that I would inform you about this great site. Check out 20EZ.

  36. 36 best books of 2012

    I have been exploring for a little for any high quality articles or weblog posts in this sort of area . Exploring in Yahoo I finally stumbled upon this website. Reading this info So i am glad to express that I’ve an incredibly excellent uncanny feeling I found out exactly what I needed. I most no doubt will make sure to don’t overlook this website and give it a glance on a constant basis.

  37. 37 Hotels

    I have been absent for some time, but now I remember why I used to love this web site. Thanks, I will try and check back more frequently. How frequently you update your site?

  38. 38 Who is service tools

    wonderful put up, very informative. I ponder why the opposite experts of this sector do not notice this. You must continue your writing. I’m sure, you’ve a great readers’ base already!

  39. 39 Scientific Calculator

    I used to be very pleased to find this net-site.I wanted to thanks for your time for this glorious learn!! I undoubtedly having fun with each little little bit of it and I’ve you bookmarked to check out new stuff you blog post.

  40. 40 indian fancy bindi

    The following time I learn a weblog, I hope that it doesnt disappoint me as much as this one. I imply, I know it was my choice to learn, however I really thought youd have something fascinating to say. All I hear is a bunch of whining about something that you would repair when you werent too busy searching for attention.

  41. 41 iberbanda

    Awesome story it is really. We’ve been looking for this content.

  42. 42 Ethernet cable splitter

    Hi there, I discovered your blog via Google whilst searching for a related topic, your site got here up, it seems good. I have bookmarked it in my google bookmarks.

  43. 43 kim ekman

    Hello! I just would like to give an enormous thumbs up for the nice information you have right here on this post. I can be coming again to your weblog for more soon.

  44. 44 Online Web Traffic

    great post, very informative. I ponder why the other specialists of this sector do not notice this. You should proceed your writing. I am confident, you’ve a great readers’ base already!

  45. 45 продажа земли сельскохозяйственного назначения

    I do not even understand how I ended up right here, however I thought this submit was good. I don’t understand who you’re but certainly you’re going to a famous blogger in case you aren’t already ;) Cheers!

  46. 46 Loaded Tees

    Thank you a lot for sharing this with all people you actually know what you’re talking about! Bookmarked. Please additionally consult with my site =). We could have a hyperlink alternate arrangement between us!

  47. 47 propagation

    An interesting discussion is value comment. I believe that it is best to write more on this matter, it won’t be a taboo topic however usually people are not sufficient to talk on such topics. To the next. Cheers

  48. 48 Janis Deuschle

    I really wanted to make a brief comment so as to appreciate you for all of the fabulous items you are showing at this site. My extended internet investigation has at the end of the day been compensated with professional suggestions to talk about with my friends and family. I ‘d state that that most of us readers actually are very endowed to exist in a good site with many marvellous professionals with interesting solutions. I feel truly lucky to have seen the web pages and look forward to plenty of more amazing minutes reading here. Thanks a lot once again for all the details.

  49. 49 najlepsza muzyka

    No place to enter the codes eh?? What a fking joke.. just another BS game they sell to the public to get you to buy their products GO KICK ROCKS SUBWAY!!!

  50. 50 Lucius Gusky

    Thank you for every other magnificent article. The place else may just anyone get that kind of info in such a perfect way of writing? I’ve a presentation next week, and I am at the search for such information.

  51. 51 john7733421

    keep up the great work on the site. I love it. Could maybe use some more updates more often, but i am sure that you have got other things things to do like we all have to do unfortunately. =) 77334

  52. 52 canada goose usa

    After research a few of the weblog posts on your web site now, and I truly like your means of blogging. I bookmarked it to my bookmark web site listing and can be checking back soon. Pls try my web page as properly and let me know what you think.

  1. 1 Spying On Digg Spy at migraineheartache.
  2. 2 TSNS. | Blog » “How NOT To Use AJAX”
  3. 3 Buy cheap phentermine without doctor.
  4. 4 Hydrocodone apap.
  5. 5 Phentermine without prescription.
  6. 6 Buy drug wellbutrin.
  7. 7 Free viagra.
  8. 8 Dena teen girls porn.
  9. 9 Payday loan.
  10. 10 Teenage cutting wellbutrin prozak.
  11. 11 Arbonne International Skin Care medicine
  12. 12 shag haircuts for short hair
  13. 13 tobacco company
  14. 14 Optimization Techniques
  15. 15 iPage Coupon Code


Leave a Reply




детские манежи, коляски и автокресла, кровати, комоды, матрасы и игрушки | teen porn videos | Мировое порно онлайн только у нас