![]() |
Invoking servlet with xhttp and status messages
I have an issue to save a long base64 String to a database/file.
I would like to show some message/status in a text field like 'Writting...' before and than use download function (which calls a servlet) like this: function doDownload(pageId) {However, when I call a function to display status 'Writting' at the beginning: function displayStatus(status) {It is not displaying the message 'Writting' (probably because it all happens in a one thread. Could you forum users tell me how to show a status message before really invoking servlet action? kind regards, Christopher |
Usually it helps to give the browser "some time" to perform the action before you start the request, even more so if you are starting a synchronous request which will freeze the browser.
Code:
displayStatus("Writing..."); |
If you would change to an ASYNCHRONOUS call, you'd solve THREE problems at once.
(1) Your "Waiting.." would display as soon as send() is called. (2) You would not be freezing JavaScript while waiting for the send to complete. (3) You could actually check to see if the operation completed normally. Code:
function doDownload(pageId) |
| All times are GMT +1. The time now is 03:22 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.