tags:

views:

92

answers:

3

I want to show the processing information or log in the original page when the submitted request is being served until it completes the execution. I thought it would be meaningful to the user to know what is happening behind the request.

I don't find a clue to do so though, can you guys help me out as how people are doing like this one below one - for your reference

http://www.xml-sitemaps.com/

+1  A: 

there are two ways i could imagine handling this:

  1. have your backend script (python) output the information of a long process to a log of some sort (text file, database, session, etc...) and then have javascript grab the information via ajax and update the current page.

  2. same deal, but instead of ajax just have a meta refresh on the page which would grab the latest updated information.

Owen
Those *are* the two ways: Javascript and refresh. Download the javascript libraries from www.xml-sitemaps.com and see what it does.
S.Lott
A: 

Thanks Owen,

I feel your first approach would fit my need and I tried the same, but end up with no luck.

I cannot contact my server by calling an AJAX function when onSubmit of form. But surprisingly I can when calling the same function by OnLoad or any other event.

Is there any restriction for asynchronous request to the same server when already an synchronous request is being processed? Please clarify.....

A: 

you may use python threading, which will create a new process in background

and display your messages on that thread

hope it helps ;)

Ahmad Dwaik