Ajax webapps are cool, but non-javascript versions still needed
I think we can all probably learn a lesson from Google. I've heard that GMail is the "gold standard" for Ajax applications. If that's the case, then you should note that they've recently added a "basic HTML" link to the bottom of their pages. With this link, you can view your e-mail using the old way: Yahoo-style, no-JavaScript-needed. My guess is they added it because of demand, or simply to compete with other providers who have this feature. I think it's a good lesson though: use Ajax features in webapps where appropriate, but don't make JavaScript necessary to use your app.
A couple of Ajax features I've been thinking of developing:
- Saving forms with XMLHttpRequest: just display a success message at the top, and switch the "Cancel" button to "Done". Since the form's content doesn't change, this seems like a reasonable use of the technology.
- Switching out entire "content" <div> elements. Most of my apps have a <div id="content">, so it'd probably pretty easy to just replace that in response to button and link clicks. Of course, the hard part is having the requested server-side object load the view template, process it, and send back the content. This is probably more trouble than it's worth.
Hi -
Making JavaScript-only versions is definitely not the only option. I think it depends on what you are developing, who is the audience, etc. It will be cool to see if we can have components which can failback themselves.
Saving forms: This is a no-brainer, and fits into background validation. Send the info, show validation errors if that it the case, else give feedback that the form was sent. We are doing this, and it is interesting. Of course, if you DO want to change the page then you can go back to 'normal' mode, or you can send back a redirect.
Switching content: We have code that lets the server send back XML, and the client replaces the part of the dom based on an id, or content tags.
Dion
Posted by Dion Almaer on March 07, 2005 at 04:19 PM MST #
I'm looking at using this project to do the content div swapping that you mention.
Posted by Scott Mitchell on March 07, 2005 at 04:21 PM MST #
We developed a product using ajax-style of development back in '99. It was powerful, but a real pain. There were so many little problems we ran into with frames and javascript. Every browser version had its own set of quirks. It's also harder to test in an automated way. (And impossible to automatically test all browser versions.) We were forced to use a functional testing product that automates IE through COM (instead of HttpUnit because of its limited JavaScript support).
The complication of the technologies used makes clean design more difficult, I think. I like the idea of having as much of the (display) logic in Java as possible. Plus you'll find yourself jumping through hoops to get the JavaScript to work correctly for all browser versions.
We are now developing a new product and going with straight frameless HTML with as little JavaScript as we can get away with. I think our customers will be happier with us overall as we'll be able to deliver a higher quality product in less time.
We plan on emulating frames via HTML tables (or equiv) and doing field level verification on the server side. It might be a little slower, but I'd rather buy a few more servers or T-1s than add risk to our software.
No sir. You can keep that technology to yourself.
Posted by Michael Slattery on March 08, 2005 at 01:56 AM MST #
Posted by PJ Hyett on March 08, 2005 at 04:03 AM MST #
Posted by SotA on March 08, 2005 at 07:40 AM MST #
The only real problem I had was the tree which is built via a javascript library and I could get it to load dynamically into its own 'portlet' div and still work. I had a hack for Firefox but IE wasn't very helpful. I'm not a wiz as javascript yet so I'm sure there is a solution, and I've seen some suggestions elsewhere but haven't had time to persue them. Ultimately though I have thought about making the underpinnings of the UI an open source project. The backend happens to be WebWork and Velocity but that was just a personal choice.
Posted by Robert McIntosh on March 08, 2005 at 04:15 PM MST #
Posted by Michael Slattery on March 08, 2005 at 05:22 PM MST #
Posted by Robert McIntosh on March 08, 2005 at 05:31 PM MST #
Posted by Michael Slattery on March 09, 2005 at 03:39 AM MST #
> JavaScript Templates project: http://trimpath.com/project/wiki/JavaScriptTemplates
> I'm looking at using this project to do the content div swapping that you mention.
Why not just use a very small function for same thing, like this:
Usage:
Result:
A variant with construction to allow emebeded javascript a bit larger so I don't include it here. (Copied from my JavaScript Server Pages project which is under LGPL license).
Posted by Volodymyr M. Lisivka on March 09, 2005 at 05:12 PM MST #
Posted by Volodymyr M. Lisivka on March 09, 2005 at 05:14 PM MST #
Posted by Volodymyr M. Lisivka on March 09, 2005 at 05:46 PM MST #
Posted by Robert McIntosh on March 09, 2005 at 06:01 PM MST #