Totally changed the approach server side, so no more need to make what described.
On 28 Nov, 10:29, Spike1 <[EMAIL PROTECTED]> wrote: > Sorry for the obscure subject, but english is not my language. > > Well, situation: > > server side language: php > > In a page, i need to call an url (on another server) that start a > process (creates a jar file assembling many other files). > > This call will be done via curl (it has been already written). > > If the result of this call is Ko, stop everything. If it is OK, I must > call (let's name this call, second call) another url which output can > be: > > 1) Error -> Stop everything > 2) Wait, not finished > 3) The file is ready > > If 1, ok I'll print out a message > If 3 I'll print out a link to download the file > If 2 I need to call again the url (and so on, until I get 1 or 3) > > I thought to use jheartbeat (http://www.ajtrichards.co.uk/heartbeat/) > to make my 'second call' , but since I'm noob, I don't know how to > make these 2 things: > > A) Launch heartbeat only if the result of the curl call is OK > B) Evaluate the 'response' of the 'second call' and stop heartbeat if > the response is 1 or 3 (then I'll append someway the message or the > link). > > I think I could attach heartbeat to a button (visible only if the curl > call response is OK) and trigger the onclick or onmouseover event, but > I'd prefer having it starting automatically if the curl call response > is OK. > > Any hint about both A and B? > > Thank you in advance, Paolo