Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #22823
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Shutting script down when leaving page |
| Date | 2014-01-27 10:41 +0000 |
| Message-ID | <270120141041247876%timstreater@greenbee.net> (permalink) |
| References | <lc4jit$bmm$1@reader1.panix.com> <R5ydnabdDqqqm3vPnZ2dnUVZ_tqdnZ2d@westnet.com.au> <6507961.N3xZG9CObR@PointedEars.de> |
In article <6507961.N3xZG9CObR@PointedEars.de>, Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote: > Andrew Poulos wrote: > > > On 27/01/2014 2:25 PM, Xox wrote: > >> Let us suppose I have a page, a.html, which contains a script which > >> constantly invokes itself or is invoked -- it's running not necessarily > >> continuously but at regular intervals, or maybe it is looping. > > There are no pages, they are not “running”, and they certainly do not > “loop”. Scripts do not “invoke themselves” either. > > Script code may cause other code to be executed repeatedly, using the > browser API, and it may cause a resource in a view to be reloaded, upon > which it could be executed again if it was part of that resource. That > is not a loop. Yet more sneering by PointyHead at people's "incorrect" use of terminology. Still, I expect it's how he's used to treating his students, if any. > > Perhaps calling onunload and/or onbeforeunload and stopping the script > > will help. > > “onunload” and “onbeforeunload” are event-handler attributes and properties. > They cannot be called by the developer to the desired effect because the > developer does not know when they should call them in the first place. > > There is an unfortunate tendency of saying that something is “called” when > any action is caused by anything, particularly among beginners. People > nonsensically speak of “Ajax calls”, for example. var request = new XMLHttpRequest (); ... request.send (data); Hmmm, looks like a function call to me. If PointyHead were less of an arsehole, he might have simply reassured the OP by describing what happens to a page being displayed, and its resources, when the user navigates to another page. IOW, behaved like a good teacher. But no. Instead, he feels an irresistible urge to demean posters by making corrections to their usage of terminology, and their manner of posting. -- "The idea that Bill Gates has appeared like a knight in shining armour to lead all customers out of a mire of technological chaos neatly ignores the fact that it was he who, by peddling second-rate technology, led them into it in the first place." - Douglas Adams
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Shutting script down when leaving page Xox <etacx18@etaoin.com> - 2014-01-27 03:25 +0000
Re: Shutting script down when leaving page Andrew Poulos <ap_prog@hotmail.com> - 2014-01-27 18:08 +1100
Re: Shutting script down when leaving page "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-27 10:23 +0100
Re: Shutting script down when leaving page Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-27 11:21 +0100
Re: Shutting script down when leaving page Tim Streater <timstreater@greenbee.net> - 2014-01-27 10:41 +0000
Re: Shutting script down when leaving page Xox <etacx18@etaoin.com> - 2014-01-27 19:43 +0000
Re: Shutting script down when leaving page "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-27 20:53 +0100
Re: Shutting script down when leaving page Xox <etacx18@etaoin.com> - 2014-01-27 20:52 +0000
Re: Shutting script down when leaving page Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-28 01:20 +0100
Re: Shutting script down when leaving page Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-28 01:24 +0100
Re: Shutting script down when leaving page "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-01-27 18:44 -0800
Re: Shutting script down when leaving page Xox <etacx18@etaoin.com> - 2014-01-28 05:03 +0000
Re: Shutting script down when leaving page Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-28 11:33 +0100
Re: Shutting script down when leaving page Xox <etacx18@etaoin.com> - 2014-01-28 19:40 +0000
Re: Shutting script down when leaving page "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-28 09:31 +0100
Re: Shutting script down when leaving page Christoph Michael Becker <cmbecker69@arcor.de> - 2014-01-27 21:37 +0100
Re: Shutting script down when leaving page Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-28 00:10 +0100
Re: Shutting script down when leaving page Christoph Michael Becker <cmbecker69@arcor.de> - 2014-01-28 00:54 +0100
csiph-web