Mastering Ajax Websites 307
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."
Ever notice . . . (Score:5, Insightful)
Re:Ever notice . . . (Score:5, Insightful)
Look at what Google Maps did for online mapping and tell me AJAX is "just a fad".
Re:Ever notice . . . (Score:5, Insightful)
Re:Ajax in action (Score:3, Insightful)
Good but bad! (Score:5, Insightful)
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.
Best thing since sliced bread! (Score:3, Insightful)
Recalling the Simpsons: "Only suckers buy [last year's] model. You are not a sucker, are you?"
I can't wait to start padding my resume with the latest and greates technology out there that will do the same thing we've been doing for decade but with more acronyms and steeper learning curve.
Re:How about a new language (Score:3, Insightful)
Too complex? As compared to what? Having each and every server-side action also generate a page for the user? With AJAX, you can have one or two pages for display, and the rest of the scripts just for sending or retrieving data.
Re:How about a new language (Score:2, Insightful)
Re:Ajax in action (Score:3, Insightful)
Re:Ajax in action (Score:5, 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.
Re:When is AJAX appropriate? (Score:4, Insightful)
You don't need polish to keep users, you only need polish to attract users. Take Slashdot as an example. Hideous design, atrocious implementation, no polish whatsoever, full of bugs, and yet people keep coming back to it.
Once you've attracted users, they rarely go away unless you give them a push (like endlessly posting repetitive articles on Ajax, for example).
Re:When is AJAX appropriate? (Score:3, Insightful)
Also, I'd clean up the terminology. You don't use it for web sites. You use it for applications.
Re:JavaScript code is the core code - What??? (Score:4, Insightful)
So... unless you disregard a significant percentage of viewers, you do need to provide an alternate version.
The article says: "Ajax is more than just the latest fad -- it's your stepping stone to build better Web sites through efficient use of your time." -- tell me how can AJAX save you time if you have to do _both_ versions of the site, multiplied by the number of differently behaving browsers?
Re:Ever notice . . . (Score:3, Insightful)
Re:Ajax in action (Score:5, Insightful)
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.
Re:How about a new language (Score:1, Insightful)
Re:Ever notice . . . (Score:2, Insightful)
At this point in the game, we shouldn't have to be jumping through hoops and playing games to get great looking web applications. Web applications should be on par with traditional applications.
--
Q
Re:Good but bad! (Score:4, Insightful)
So, unless we end up with one web browser, we'll never have a common object model and will therefore always have incompatibilities.
Re:Ever notice . . . (Score:3, Insightful)
Re:How about a new language (Score:3, Insightful)
Re:(raises his hand) (Score:2, Insightful)
Re:XML (Score:3, Insightful)
He used JavaSCRIPT. Big difference.
Re:How about a new language (Score:3, Insightful)
At any rate, it may not be the best use of your time, but were I actually developing a web-based application that needed a sophisticated client, I wouldn't rule Flash out, depending on what the back end system I was developing on was. Like it or not, Flash has one big advantage over Ajax and, for that matter, HTML/CSS in general: it bypasses browser compatibility issues entirely.
Whatever happened to Java applets? (Score:1, Insightful)
I'm genuinely confused. What does AJAX give you that Java applets do not? For example, people talk about Google's mapping application, and the ability to drag the map around. Isn't this something that Java was supposed to be able to do? And as far as browser incompatibilities go, isn't that what a Java applet program could circumvent?
What am I missing here? Furthermore, AJAX seems to force open source -- all of your source code is available so that malicious people can exploit its vulnerabilities.
Re:Ever notice . . . (Score:5, Insightful)
Re:Ever notice . . . (Score:3, Insightful)
Well, tough shit. That's what the web is being used for. Do you really think that the web would have been successful without ecommerce? Ecommerce is a web application. Any site that takes input from the user and does something with it is a web application. Slashdot is a web application.
The whole point of DOM, DHTML, scrpting, XML, CSS, and practically every web standard for the last 7 years has been to facillitate using the web for applications. Just about everyone is on board with this, but there's always a few that want to retard progress.
Web applications do exist, they aren't going away, and any attempt to change this fact is just pissing into the wind. Stop being part of precipitate and start being part of the solution.