joined:Aug 20, 2004
Hello All -
Here's the scenario:
1. User deletes an item from a page.
3. a modal dialog appears notifying the user that the item has been successfully deleted. The user must click the "OK" button on the modal for it to dismiss.
All of the above works fine, except when...
The user deletes the LAST ITEM on a page window.location.href take the user to another page.
Under this circumstance, the:
- Item is deleted
- User is automatically re-directed
- Modal appears, but disappears within a few seconds without the user needing to click the ok button.
What is appearing to happen is that window.location.href is still happening when the modal is fired... but what's weird is that window.location is called BEFORE the model is called.
The actual code-calls are here:
// Redirect if needed
if(data.redirect) window.location.href = data.redirect;
// Display remaining data from database
// Fire confirmation modal dialog
Anyone got any idea on how to (if this is even the problem) make sure the re-direct has completed BEFORE the modal is called.
All guidance gratefully appreciated!