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


Groups > comp.lang.javascript > #22832

Re: Shutting script down when leaving page

Message-ID <10703674.pIetZOEVdU@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2014-01-28 01:20 +0100
Subject Re: Shutting script down when leaving page
Newsgroups comp.lang.javascript
References <lc4jit$bmm$1@reader1.panix.com> <R5ydnabdDqqqm3vPnZ2dnUVZ_tqdnZ2d@westnet.com.au> <6507961.N3xZG9CObR@PointedEars.de> <270120141041247876%timstreater@greenbee.net> <lc6cta$n8c$1@reader1.panix.com>

Show all headers | View raw


Xox wrote:
^^^
Please fix this.

> I am sorry my vocabulary offended.

ACK.

> (Although I don't know what the statelessness of HTTP has to do with
> anything.)

You told of “pages”, meaning documents, being “active”, which is utter 
nonsense with a stateless protocol.  The document resource is served, i.e. 
transferred from the server to the client, and that is it.  Only a client-
side *script* can be “active”, i.e. running.

> I will explain in another way.  I have a page which has some

You do not have a page, you have a document.

> Javascript functions on/in it.

There is no “Javascript”, but, for the sake of discussion, let us continue 
under the assumption that you wrote “JavaScript”, even though even that term 
is insufficient to describe the situation.

> Some of the functions are repeatedly called/started/invoked/run by
> setInterval or setTimeout.  They look to see whether certain objects etc.
> are present and where they are, and may move or create other objects
> accordingly. There could be a lot of these objects.  The functions could
> thus consume a lot of resources.
> 
> Now suppose the browser navigates to another page.

s/browser/user/
s/page/resource/

> I am wondering whether some browsers may continue to execute the
> aforesaid function invocations anyway.

Some do.

> I would think not,

Why?

> but stranger things have been coded.

Indeed.
 
> I could make a list of the ids returned by setInterval
> and run clearInterval against each on the onunload event,

Good idea.

> but I'd just as soon not bother if it's superfluous.

ACK.  (Some people with less understanding of English appear to have 
misunderstood you here.  Keep in mind that this is an international 
newsgroup, so it is best to avoid the more peculiar idioms of the
language in order not to be misunderstood.)
 
> Does anyone know?

Yes.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

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