Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Mel Smith" Newsgroups: comp.lang.javascript Subject: Re: Suspending the flow of JS/ES execution Date: Thu, 12 Sep 2013 18:42:18 -0600 Lines: 53 Message-ID: References: <4fpYt.72772$wA2.68551@fx32.iad> <1ddaiqhh6qdpo.1f6innudnejww.dlg@40tude.net> X-Trace: individual.net TD4lSFWMCOZetUjhvUe+bg2fEHnEqlF7XAFn62teosEzjBNzGx Cancel-Lock: sha1:5KoGrvGVrs5UQS50ap2qKBEQRls= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: csiph.com comp.lang.javascript:21312 JJ said: > No you don't. But our Alert function merely add a new element into the > document then returned. Its job is done as it should. What you need to do > is > to move the codes after the "Alert(...)" execution into a callback > function. > That callback should be called after AlertFin is executed. The flow should > be like this: > > Alert > (idle) > AlertFin > callback > > > So first, convert the code after calling the "Alert(...)", into a callback > function: > > function alertCallback() { > someobj.focus(); > } > > function somefunc() { > Alert(cmsg, alertCallback); > return; > } > > Then change the Alert definition to this: > > function Alert(cmsg, callback) > > Then in the Alert function, change the INPUT HTML code to: > > > > Still in the Alert function, append this lines: > > getobj("ialertokbutt").onclick = function() { > AlertFin(); > if (callback) { > //note: type checking of "callback" parameter is absent > callback(); > } > Hi JJ: I will try to absorb what you suggested tomorrow. My brain is old and filled and now tired tonite :( Thank you for the suggestions ! -Mel