Slashdot Mirror


Mastering Ajax Websites

An anonymous reader writes to tell us that IBM DeveloperWorks has an interesting article introducing the uninitiated to the world of Ajax. From the article: "Ajax, which consists of HTML, JavaScript technology, DHTML, and DOM, is an approach that helps you transform clunky Web interfaces into interactive Ajax applications. The author, an Ajax expert, demonstrates how these technologies work together. Ajax is more than just the latest fad -- it's your stepping stone to build better Web sites through efficient use of your time."

23 of 307 comments (clear)

  1. Ever notice . . . by Ph33r+th3+g(O)at · · Score: 5, Insightful

    . . . how when a new fad comes along, people say it's not a fad?

    --
    I too have felt the cold finger of injustice.
    1. Re:Ever notice . . . by ceejayoz · · Score: 5, Insightful

      Sure, but when something useful comes along, people say it is a fad.

      Look at what Google Maps did for online mapping and tell me AJAX is "just a fad".

    2. Re:Ever notice . . . by phoenix.bam! · · Score: 4, Insightful

      Ajax is a fad and it isn't. All the hype about it is of course, generated because it's the awesome new fad. But it is an incredibly useful tool. Digg.com does a great job of using AJAX the proper, no intrusive way. GMAIL too. It's great for some things and won't be going away soon. But soon there won't be 20 stories a week posted about it.

    3. Re:Ever notice . . . by baldass_newbie · · Score: 5, Funny

      That's why I use COMET (Common Object Meta Event Transactions) instead of AJAX.
      It keeps my websites Spic and Span.

      Oh wait...

      --
      The opposite of progress is congress
    4. Re:Ever notice . . . by BorgCopyeditor · · Score: 4, Funny

      Better watch out! Despite his bald head and suspiciously gay-looking earring, Mr. Clean is gonna kick all y'all's asses!

      --
      Shop as usual. And avoid panic buying.
    5. Re:Ever notice . . . by subtropolis · · Score: 4, Funny

      I wish people being stupid was just a fad.

      --
      "Our interests are to see if we can't scale it up to something more exciting," he said.
    6. Re:Ever notice . . . by thevoice99 · · Score: 4, Funny

      I agree. There are so many things on the internet that just get extensions ontop of them instead of rewrites of the base technology. Why are we even using HTML still?

    7. Re:Ever notice . . . by m50d · · Score: 4, Insightful

      Web applications shouldn't exist. It's as simple as that. They're an attempt to shoehorn the web into something very different to what it was designed for - it's meant as a documents platform, not an applications platform. If you want to run remote applications, there are plenty of ways to do so - X11 is the obvious one. If you feel it's inadequate for the higher-latency environment of the internet, you're probably right - but the solution to that is not to try and get http to do applications, it's to write a new protocol for doing internet applications. That's what we should have - a new, standard way of doing applications over the internet, designed for doing applications over the internet, and optimized for this task.

      --
      I am trolling
  2. Well done by gustgr · · Score: 4, Informative

    Interesting post. This kind of introduction might help beginners (like me) to know more about this new mix of different technologies and avoid confusion. Just these days a friend of mine said to me that he would like to learn this new "Ajax programming language". Many people still think that way. Thumbs up for the article.

  3. Ajax in action by gustgr · · Score: 5, Informative

    A nice example of Ajax usage can be found at http://www.meebo.com/.

    1. Re:Ajax in action by OverlordQ · · Score: 4, Interesting

      My only complaint about AJAX sites is it makes bookmarking something damn near impossible.

      --
      Your hair look like poop, Bob! - Wanker.
    2. Re:Ajax in action by Bogtha · · Score: 4, Insightful

      That's not Ajax, that's developers who have screwed up. You can have Ajax and addressability (bookmarks, back button, etc) for 99% of the things Ajax is good for. It's just you have all these newbie web designers jumping on Ajax like there's no tomorrow, so most of the things you see have had lots of shortcuts taken, and some of the things you see shouldn't have used Ajax in the first place.

      A good rule of thumb for knowing when it's appropriate to use Ajax is where you intend on posting something to the server, and then redisplaying the page you just came from. For example, Slashdot's moderation. It makes no sense to regenerate the entire page just to tell the server what you think of one particular comment. This is also the situation where bookmarks, the back button, etc aren't going to break.

      --
      Bogtha Bogtha Bogtha
    3. Re:Ajax in action by Bogtha · · Score: 4, Interesting

      Umm.. ctrl+click link for email.

      ...and that would work if Google hired somebody competent to write their Javascript. But they hired people who use spans and onclicks instead of <a href="...">s, thus taking the addressibility away, thus taking the bookmarks, tabs, etc away too.

      --
      Bogtha Bogtha Bogtha
    4. Re:Ajax in action by Geoffreyerffoeg · · Score: 4, Insightful

      A good rule of thumb for knowing when it's appropriate to use Ajax is where you intend on posting something to the server, and then redisplaying the page you just came from.

      Completely. AJAX should only be used when you would've POSTed something to the server and made a slight change - both of those are non-bookmarkable and non-addressable. (Good) web designers seem used to when to GET and when to POST, so only use AJAX in the latter case. The general rule for that, by the way, is that POST should change stuff on the server, and GET should only retrieve data. Thus, you can only bookmark a view of data, not a change of it - you've already changed it once you're ready to bookmark.

      AJAX can actually help with the entire problem of tabs and forms - if the form only changes data but doesn't update the view, you can use a regular link to see a different view of it.

      The other solution is to do what Google Maps does - since they're using AJAX to retrieve views, they have a button called "Link to this view" or something that gives you a context-free URI to that particular view.

  4. JavaScript code is the core code - What??? by danwiz · · Score: 4, Interesting

    From the article:
    JavaScript code is the core code running Ajax applications and it helps facilitate communication with server applications.

    Depending on JavaScript could be its downfall, since JavaScript has so many functional work-arounds for each browser. Even the article mentions (but dismisses) this problem.

    From the article (again):
    Microsoft's browser, Internet Explorer, uses the MSXML parser for handling XML (you can find out more about MSXML in Resources). So when you write Ajax applications that need to work on Internet Explorer, you need to create the object in a particular way.

    "Particular Way" for browser one ... "Particular Way" for browser two ...
    Sounds like in an inherently poor design.

  5. Why AJAX matters by Geoffreyerffoeg · · Score: 5, Interesting

    AJAX isn't an end in itself; it's just a tool. It's like JavaScript. Back when the web was old, if you wanted to do data validation for a form (for example), you had to send the page to the server and wait for a new page as a response. When JavaScript became popular and well-enough supported, the webpage itself could check data before sending it to the server - although the checks couldn't be that complicated. AJAX is similar; instead of limiting yourself to either using a new page or client-side data, AJAX lets you use JS to access server-side data.

    As a concrete example, play with Google Maps for a couple of minutes, then try using a map from MapQuest. It will quickly start to annoy you that you can't drag the map and that you have to click to a new page to move the map around. GMaps isn't pure AJAX, admittdly, since it deals with picture data - it can just write the image tags to the page and move them around as you drag. But the side text and the map searches are AJAX - when you click search, you don't open a new page with the search results. You can keep using the map; the client will turn your search into an XML request, Google will process it, and send the results back as XML - asynchronously.

    For another example, I wrote this week a dead-simple chat program (because I needed a specific feature). It was simpler to write a web app instead of a real app, because the latter would require networking, windowing, and whatnot - the web interface made GUI easy and manual networking irrelevant. Without AJAX, I would need to have the page reload every second to check if there are new messages - very distracting. I had the system asynchronously check for messages in the background, and when one arrived, update just that part without refreshing the page.

    AJAX is a tool to be used when necessary. Don't freak out over it, but realize it's there whenever you need to use a more application-like interface instead of a page-like interface.

  6. Good but bad! by ech00ne · · Score: 5, Insightful

    AJAX doesn't make it easy to develop cross-platform web applications. Look at all the browser incompatibilities in the developing of Gmail and more recently MSN's start.com page.

    We need to re-standarize Javascript or at least make sure all the browsers implement a 100% compatible version. And I don't think that will work since not even HTML is properly rendered by any browser at all.

  7. Re:How about a new language by Fahrvergnuugen · · Score: 5, Interesting

    Well, as soon as we get all of the web browsers out there to adopt your so called "new language", we'll be all set. Your comment about Macromedia Flash made me laugh. Explain to me how Action Script interacting with the server with XML.send() is any different than JavaScript using XMLHttpRequest??

    Obviously you're not a web developer ;)

    Instead, how about a JavaScript 2.0? The language is only short a few key elements (like a native JSON serializer).

    I started developing web based applications 7 years ago. At that time, JavaScript was really only useful for image mouse overs and was more or less useless and I refused to use it for anything.

    Well, about 8 months ago I decided to give JavaScript another chance. All I can say is, wow it's come a loooong way.

    I'm a bit skeptical of all of the frameworks that have popped up. They seem to overcomplicate things profoundly. I've looked at a lot of them, but haven't decided that any of them are less work than the solution I developed on my own.

    My approach is to use JSON instead of XML. I have a server side script (can be any language, I used PHP for my last application) which acts as a listener script. The listener script accepts and sends JSON strings. The client JS composes and sends JSON strings with XMLHTTP request.

    It's clean, fast and simple to maintain and expand. I think these claims of AJAX being "too complex" are ridiculous.

    --
    Kiteboarding Gear Mention slashdot and get 10% off!
  8. Re:JavaScript code is the core code - What??? by Bogtha · · Score: 4, Informative

    "Particular Way" for browser one ... "Particular Way" for browser two ... Sounds like in an inherently poor design.

    The incompatibility you are talking about is the direct result of Microsoft implementing XMLHttpRequest with ActiveX, and everybody else implementing it as a native Javascript object. Microsoft are changing their implementation in Internet Explorer 7 to be compatible with everyone else.

    So no "inherently poor design", just a historical artifact that is a) easily worked around, and b) going away.

    --
    Bogtha Bogtha Bogtha
  9. Have you tried Laszlo? by spoco2 · · Score: 5, Informative

    Not trying to spruik it or anything, but I'm currently working on a project of making a webapp using Laszlo.

    It's an open source language/server for creating flash based applications.

    We've found it to be very impressive how much you can do with so little code... and it's nice to have a proper OO backend to a flash frontend... the flash frontend means we can:

    a) Make our interface very pretty and like a 'normal' application
    b) Means it works in pretty much any browser...
    c) on pretty much all platforms...
    d) without a download of any plugin in most cases (just because of the penetration of flash)

  10. Which stereotypical AJAX rant should I post... by cheesy9999 · · Score: 4, Funny

    I just can't decide:

    1) point out that AJAX is nothing new, it's just a fancy schancy buzzword for DHTML+XMLHTTPRequest, and that I'm so cool since I've been using it since 1997 long before someone coined the term. In fact, long before XMLHttpRequest was even invented!

    2) "Web 2.0" is retarded why do we need to version the web, Flickr sux, GMale sux, Google Maps sux, and anything with fancy javascript interfaces, rounded boxes, and pastel colors sux

    3) obligatory overused joke regarding AJAX the cleaning supply

    --
    -tom
  11. XML by TubeSteak · · Score: 4, Funny

    If by useful you mean allowing MySpace to get pwn3ed, then yes, AJAX is useful.

    Remember the Samy worm?
    http://namb.la/popular/tech.html

    He used html, java, dhtml, xml...
    Especially XML

    AJAX seems to be like Darth Vader... Powerful, yet dangerous.

    --
    [Fuck Beta]
    o0t!
  12. Just finished a chat application using AJAX by eyebits · · Score: 5, Interesting

    I've been working on a project that provides a web-based environment for people with a medical condition to get counseling and support online. Chat has been one of the desired features, but the various methods for implementing chat were presenting a problem. Java applets and Flash applications presented problems with time to load for modem users as well as issues with having the right versions of Java/Flash player installed on client. I thought setting up a Jabber server and letting folks use a client installed on their computer would be a good solution, but many (most) found it too difficult to install and configure a chat client. (These are older folks often with little computer experience.) AJAX came to the rescue. The "chat client" is part of the web application. It is as lightweight as the typical web pages being loaded. The exchange of messages between client and server require very little bandwidth. The chat application is just part of the same environment that the users are already comfortable using. I don't see AJAX as the answer to everything and, for the moment, having web applications chock full of AJAX doesn't make sense. But, it has come in very handy in the case of chat for the project I am working on.