Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22814

Re: Shutting script down when leaving page

Newsgroups comp.lang.javascript
Subject Re: Shutting script down when leaving page
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <lc4jit$bmm$1@reader1.panix.com> <R5ydnabdDqqqm3vPnZ2dnUVZ_tqdnZ2d@westnet.com.au>
Date 2014-01-27 10:23 +0100
Message-ID <XnsA2C269C8FF8AAeejj99@194.109.133.133> (permalink)

Show all headers | View raw


Andrew Poulos <ap_prog@hotmail.com> wrote on 27 jan 2014 in 
comp.lang.javascript:

> 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.  In any case it's
>> active.  Now the viewer goes to an entirely different
>> page using the same window/tab, so a.html has disappeared.
>> It seems reasonable to assume that the script would stop
>> running.  But is this in fact known to be the case across
>> all contemporary browsers?  The reason I ask is that I
>> observed some CPU usage which seemed to indicate that
>> something was going on after the page had been left.
>> The script I am dealing with could be costly in terms
>> of CPU and if it continues to run I should shut it
>> down explicitly when the browser leaves the page.
> 
> Perhaps calling onunload and/or onbeforeunload and stopping the script 
> will help.

Methinks this is nonsence.

Let us not prescribe a cure before we detect an illness.

Is there any evidence showing this fairly illogical idea?

It feels like a believe in postmortal life,
while death is defined as the end of life.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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