Path: csiph.com!aioe.org!news.mixmin.net!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: setInterval Date: Tue, 07 Feb 2017 17:23:17 +0100 Organization: PointedEars Software (PES) Lines: 39 Message-ID: <5012603.DvuYhMxLoT@PointedEars.de> References: <6cb902b0-8913-4b65-954d-5d9f0e60ee95@googlegroups.com> <4cbfae02-e217-436d-8c41-004de444915c@googlegroups.com> <8e741582-e2a8-4713-b49d-6bd5a50a8317@googlegroups.com> <87h947e7f5.fsf@bsb.me.uk> <82f4ba9f-8d80-4769-842a-5a9b066efb5a@googlegroups.com> <5898e78d$0$18070$e4fe514c@newszilla.xs4all.nl> <3141f801-2946-40fc-87ad-97668f7061e4@googlegroups.com> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1486484597 19869 eJwNysEBwCAIA8CVQEiAcbQ2+4/Q3vsQdD6VBBOCFtZJXTUrjqU3xog0V/xjz26+TVzGKKvjA/+ID84= (7 Feb 2017 16:23:17 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Tue, 7 Feb 2017 16:23:17 +0000 (UTC) User-Agent: KNode/4.14.2 X-NNTP-Posting-Host: eJwFwQkBwDAIA0BL5UuYHArDv4TehUHQdAQ8NhZFJnm7/mFfX6kT6oSNns1UDD67s6rVIv4AIA8RAA== Cancel-Lock: sha1:tGptlka7bfRkSa0JuuL+OMVnPdA= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. wrote in message ^ Who? > news:c8d749e4-8813-498c-a763-bc345854732d@googlegroups.com... Attribution _line_, not attribution novel. >> function INTRO(){ >> mycount=25; >> document.getElementById('mysubset').selectedIndex=1; >> while (mycount>-1){ >> refresh = setTimeout("COUNTDOWN();",200); >> mycount--; >> } >> } >> >> One would think that this would set a timeout 26 times and call the >> function COUNTDOWN, but that is not what it does. > > That is not what one would think... ACK. > Here is a working example for your perusal. […] If something is to occur repeatedly in equal time *intervals*, then it might be better (depends on the use-case) and is certainly easier to call window.setInterval() once instead of window.setTimeout() several times. window.clearInterval() could then be called once the number of desired calls of the user-defined function has been reached. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.