A notch above a monkey

Multitasking with POST requests - part II

Yesterday I wrote about my wish of making background POST requests that don’t get accidentally canceled. I wasn’t specific enough. You can create background POST requests just fine with XMLHttpRequest , but you can’t use such requests for file uploads, which is what I want.

My first try was to post form to iframe in a different window. This didn’t work because browsers pay attention to source of request. Activating new request in source window immediately cancels previous unfinished one.

A better idea was provided by always helpful dojo developers. Clone form to progress window and submit it from there. This one works great in Firefox, but hardly anywhere else. It certainly doesn’t work in IE, since IE is very picky about what you do with nodes created with cloneNode and you can’t clone form yourself, since it’s not possible to set the value of file upload elements.

Is this game over for unobtrusive file upload?

Not yet. There are still at least two posibilities, both with downsides, but one of them definitely works. You can open file upload form in new window and change that window to progress bar. It works and I use it occasionally, but it’s not nice if you care about accessibility. It’s something users can do now, if they want, by opening upload page in new tab or window.

The other, yet untried, possible solution would be to avoid cloning. Just rip the form out from original page, move it to status one and submit form there. Obvious problems with this one are that users lose information about what they’re uploading and that it can look confusing if not executed well.

I’ll try it anyway and will let you know how it goes.

Update: IE also dislikes ripping and moving.

Multitasking with POST requests?

I have a kinky wish. I’d like to submit a web form that wouldn’t get canceled if I clicked another link before its completion.

Browsers normally don’t work like this. They interpret subsequent clicks on active elements as a change of heart on user’s part and cancel previous clicks in favor of last one. Most of the time this is exactly what you’d want and expect.

However, sometimes it isn’t. I’d like to open a new window for upload progress bar and release the old one so users can continue working without waiting for upload to finish. I suspect it can’t be done though.

Has anyone had more luck with this?

Telemarketing scum

I’ve spent yesterday on Vienna, which was very cold and very snow-less. As it always happens, I get most phone calls when I have the least time for them and they cost me the most.

One of them was from telemarketing scum. Do you know what they thought I’ve been really missing?

A course on how to use computers.