Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #21325
| 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" <med_cutout_syntel@aol.com> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Suspending the flow of JS/ES execution |
| Date | Fri, 13 Sep 2013 09:09:39 -0600 |
| Lines | 50 |
| Message-ID | <b9go5nF95qcU1@mid.individual.net> (permalink) |
| References | <b9ekdcFqih1U1@mid.individual.net> <4fpYt.72772$wA2.68551@fx32.iad> <b9eob3Frcm0U1@mid.individual.net> <1ddaiqhh6qdpo.1f6innudnejww.dlg@40tude.net> |
| X-Trace | individual.net fQvnfOj4cpYWOX+Rz6moUgBKibgEtsVFczA2WhBuUzybZ7nORm |
| Cancel-Lock | sha1:pc3fGjk3qguaSRkHFVhInOW8ctI= |
| 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:21325 |
Show key headers only | View raw
JJ said:
> ..... 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:
>
> <input type="button" id="ialertokbutt" value="OK" />
>
> 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:
It works perfectly.
Thank you very much for the info on Callbacks !
-Mel Smith
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Suspending the flow of JS/ES execution "Mel Smith" <med_cutout_syntel@aol.com> - 2013-09-12 13:53 -0600
Re: Suspending the flow of JS/ES execution Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-09-12 13:12 -0700
Re: Suspending the flow of JS/ES execution "Mel Smith" <med_cutout_syntel@aol.com> - 2013-09-12 15:00 -0600
Re: Suspending the flow of JS/ES execution JJ <duh@nah.meh> - 2013-09-13 04:53 +0700
Re: Suspending the flow of JS/ES execution "Mel Smith" <med_cutout_syntel@aol.com> - 2013-09-12 18:42 -0600
Re: Suspending the flow of JS/ES execution "Mel Smith" <med_cutout_syntel@aol.com> - 2013-09-13 09:09 -0600
Re: Suspending the flow of JS/ES execution "Mel Smith" <med_cutout_syntel@aol.com> - 2013-09-13 10:11 -0600
Re: Suspending the flow of JS/ES execution "Mel Smith" <med_cutout_syntel@aol.com> - 2013-09-13 13:07 -0600
csiph-web