Topics
Dates
200902 · 05 · 06
2008
01 · 02 · 03 · 04 · 07 · 08 · 09 · 11
2007
06 · 07 · 08 · 09 · 10 · 11 · 12
Also check out FishoftheBay.com for more thoughts about design and life.
Improving User Experience Through Client-Side Scripting
Javascript July 27, 2007
I feel pretty comfortable with AJAX and Javascript nowadays, which is great because I just started playing around intensely with these two languages in late April.
Being that I'm interested in user-interface design and how people interact with technology, I'm almost sorry that I wasn't as familiar with these ideas earlier. But then again, not knowing it at first has made me appreciate it all the more. As far as user experience is concerned, AJAX and Javascript really improve it.
Javascript

For one, if you're going to display a bunch of content on a page on load, sometimes it's good to hide some and show it via a link that calls a Javascript function. It's always nice to go to a site and be able to see everything you need without having to refresh the page. No one wants to sit through another minute of waiting for the page to load just to see some other content that could easily have been put somewhere on the previous page.
Client-side scripting is also a lot faster than server-side. So if you're going to validate a form, might as well do it through Javascript and have instant results, versus reloading the page and having PHP check every value, echoing an error if it finds one.
AJAX
The great thing about AJAX is that it gives you all the functionality you would otherwise get from loading a new page, except the user doesn't have to sit and wait for the page to load.
I think the best use of AJAX is what I call the "secret use", where AJAX calls are sent to the server without the user even knowing. Usually for large tasks, the user will be presented with your typical animated gif loading icon, so they know something's up. But if it's simply updating a database with some info, there's no need to let the user know necessarily. You can let the AJAX call run in the background and the user can continue using your site, unaware that a simple click he/she made that took a second has altered some setting in the database.
This is particularly useful for editing settings and the like, where you wouldn't want to refresh the page after every change, nor set a bunch of properties in a form and click "Save" at the very end.
What now?
Well I can't imagine ever going back to my "static" ways. When starting work on a new site, my first thought is how to make it Javascript and AJAX-based. A little extra work on your part as the developer goes a long way for the user's experience.
After all, isn't the goal to make everything appear simple?
Other Javascript Posts
An AJAX Restaurant
I was putting together a little presentation talking about what AJAX is and why it's useful and I was trying to think of some kind of real-world analogy to explain the benefits. I came up with the interactions you have a...
Press Enter to Submit
This is just a quick entry to mention that forms should always be allowed to be submitted using the Enter key. Sometimes when you want the form to do something special (i.e. some special Javascript/AJAX function), use...
AJAX solutions
For a neat collection of AJAX articles, visit Smashing Magazine. So yeah, I've gotten really comfortable with using Javascript and AJAX everywhere. It really makes things both easier and cooler, mostly because all upd...