.... a click on the anchor will do this in this order -act like its loading a page (the important part) -make the ajax call -when the ajax call is successful it follows the link -if the ajax is unsuccessful, nothing happens
i'm trying to duplicate that with the click of a <button> or the change of an input field. the part i'm missing is when the user clicks the button the browser just sits and waits for the ajax call to finish then on success it starts to load the new page.
I would check in your callback function, that when the XML request has returned successfully, that you redirect at that moment, using something like the following: document.location = 'page.php';
You never want to say something like "well this browser does it this way" because you never know if that will be the same behavior on another browser, perhaps another version, or whatever the case may be. You always want to know exactly what is going to happen and when. Doing it the way I explain should achieve this effect.
thats exactly what i did for the button scenario.... the only side effect is when the user clicks the button, the browser doesn't act like its doing anything until the ajax completes and then it redirects. I want the user to be able to tell their click is doing its thing.
All AJAX applications have that problem. Most of us "solve" it by adding a little animated gif (called a "spinner") near whatever object triggered the event. So if they click a link, have spinner appear next to the link, until the AJAX request resolves itself.
I was leaning toward a solution like that... but i was thinking a "wait" cursor, so i did a...
document.body.style.cursor = 'wait' ;
but if the body doesn't fill the window, its the arrow cursor in the non-body part of the window. whats the proper way to do this?