954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

ajax progress bar while php exec command

Hello all.
Even though my javascript/ajax knowledge is very low, I would like to be able to do the following, for which I ask you for help:

I have a python script that runs from php with exec command. It takes about 5-10 seconds to complete. While the python script is processing I would like to show a progress bar to the user. In fact, it doesn't need to be a progress bar, a 'loading... bar' would be more than enough.

As I have already said, I don' know much about this, but I think I need ajax to do this. Googling about this I have found this blockUI plugin that seems great.

I know I have to use something like $().ajaxStart($.blockUI).ajaxStop($.unblockUI); but I really don't know how.

Here are some 'chunks of of code' I think will be necessary:

<script src="jquery-1.3.2.min.js"></script>
<script src="blockUI.js"></script>
<script type="text/javascript"></script>
$.blockUI({ message: '<h1><img src="busy.gif" /> Just a moment...</h1>' });
</script>
<script type="text/javascript"></script>
$().ajaxStart($.blockUI).ajaxStop($.unblockUI);
</script>


Sorry if I seem to vague, but I really don't know much about this and would be very grateful if anyone could help me out on this. Thanks.

nunos
Light Poster
47 posts since Aug 2009
Reputation Points: 10
Solved Threads: 0
 

Anyone? Thanks.

nunos
Light Poster
47 posts since Aug 2009
Reputation Points: 10
Solved Threads: 0
 

I know this thread is really old, but in case it helps: take a look at http://api.jquery.com/category/ajax/global-ajax-event-handlers/ . You can throw functions that show and hide your message at ajaxStart() and ajaxStop().

twiss
Veteran Poster
1,005 posts since Apr 2010
Reputation Points: 177
Solved Threads: 101
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: