Posted by Tim Wed, 28 Sep 2005 13:59:00 GMT
Stickman has posted a cool DOM-scripted multiple form upload and, of course, through no fault of his, commentors are assumming it must be AJAX, since it’s on the web and it’s new and cool. PPK has talked about this issue before but it looks like calling everything “AJAX” really is spreading to even geek bloggers watching web development (it’s only in the talkbacks, so far) who you would hope would be Marketing-ese proof.
Now, we’ve got nothing against AJAX, it’s a great technique that we like using, as appropriate, but this is DOM-scripting pure and simple. AJAX-like technologies have to do with how you handle the round trip to the server without reloading the page and, in this context, would look more like this (thanks to one of the other posters for the link). AJAX could be added onto Stickman’s work to just refresh the part of the page handling the upload, and something similar is used by Basecamp, already, to get around the multiple file upload another way.
Personally, I think what Stickman is doing is far cooler than AJAX, as he’s getting around a more fundamental browser limitation. What you can do with the HTML form upload control is severely restricted in browsers, largely for security reasons. For too long it’s been a basic assumption in web development that you might as well not try to do anything fancy with the form upload widget, since it’s fairly locked down. In fact, it’s still possible for the browser implementors to decide that hiding the widget is a potential security risk, and then this technique goes out the window. Until then, though, it’s useful to have in the toolbox, and even if it gets locked-out by some browsers in the future, it still gets us thinking about how to work around those limitations again.
Generally, I think the Basecamp approach of actually doing it through AJAX (similar to the “this” link above) would often be a better choice, as it allows more granular feedback and control. For instance they confirm each upload and then allow you to re-label it prior to sending a message off. This also avoids having to wait for one massive upload at the end, which might kill your whole message, instead of just the individual upload. Regardless, Stickman’s approach is still cool.