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


Groups > comp.lang.javascript > #22839

Re: Shutting script down when leaving page

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="UTF-8"
Message-ID <231821878.aeL59MFQ59@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Organization PointedEars Software (PES)
Date Tue, 28 Jan 2014 11:33:33 +0100
User-Agent KNode/4.11.3
Content-Transfer-Encoding 8Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
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==
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> <10703674.pIetZOEVdU@PointedEars.de> <lc7dnh$n8c$3@reader1.panix.com>
MIME-Version 1.0
Lines 123
NNTP-Posting-Date 28 Jan 2014 11:33:35 CET
NNTP-Posting-Host 7d3403fa.newsspool2.arcor-online.net
X-Trace DXC=k3nc4H?^l0c016@cHD@m;jA9EHlD;3Ycb4Fo<]lROoRa8kF<OcfhCOkV0:d_FN7TIiDZm8W4\YJNlYUVHKH;GI^gA:4gUTI10KaNQ<gg[86]Mi
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.javascript:22839

Show key headers only | View raw


Xox wrote:

> On Tue, 28 Jan 2014 01:20:22 +0100, Thomas 'PointedEars' Lahn wrote: 
>> Xox wrote:
>> ^^^
>> Please fix this.
> 
> What would you prefer?

Your real name, of course.  You may insert your nickname as well, though.  
See my From header field value for an example.
  
>>> I will explain in another way.  I have a page which has some
>> 
>> You do not have a page, you have a document.
> 
> Well, actually, I wrote a 'page' of code,

Actually, you did not.  You wrote a file that contained, or maybe a program 
that generated, a document.  There is no page unless you print it out.  But 
the advantage of HTML, and the Web in general, is that presentation of 
content depends on the medium of presentation.

> which implies a document,

Hypertext resources on the Web, especially HTML resources, are called 
documents.

<http://www.w3.org/TR/html4>
<http://www.w3.org/TR/html5>

This use originates from the beginnings of the World Wide Web, at CERN:

<http://www.w3.org/History/1989/proposal.html>

> but when I wrote it, it was a page, that is, an HTML file,

You are using terminology that is not well-defined.  Such leads to confusion 
and is to be avoided.

> which happened to include scripts.  That gets turned into a document when-
> it is read and interpreted,

No, before.

> but it was not a document in the sense I think we are using this word when
> I wrote it.

See above.
 
>>> 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.
> 
> Out of curiosity, I wonder what you would prefer.
> I thought I was writing Javascript, I used grammar
> widely attributed to Javascript, and hence I
> wrote my question in a newsgroup called, of all
> things, comp.lang.javascript, where we are having
> this discussion, so you can see how I might have
> gotten that impression.

First of all, you are using wrong spelling, in particular wrong character 
case.  Second, “JavaScript” is only the name of one ECMAScript 
implementation used in browsers; one of many.  Read the ECMAScript Support 
Matrix for details.

I would prefer “functions written in/for an ECMAScript implementation” of 
course, but I can see that this may not be practical.  Thus, since we are 
already discussing in comp.lang.javascript, we can make use of the context, 
drop the superfluous attributes altogether, and just say “functions”.  The 
dedicated reader will then be able to infer from the context that what we 
meant were entities that are described exactly using the words in the first 
sentence of this paragraph.
  
>>> I would think not,
>> 
>> Why?
> 
> I may be showing my age, but back in the day, if you
> didn't need a resource, you got rid of it -- you freed
> memory, and stopped processes/threads/tasks/transactions
> that were no longer useful (in this case, to affect what
> the user sees/hears etc.)  Conceded, you might keep the
> material around if you thought it could be revisited in
> the near future.  But indefinite retention of the resources
> seems likely to bog down the supporting platform.
> 
> But maybe nobody cares any more.  I read somewhere that
> Firefox kept allocated memory around indefinitely until
> the process(es) terminated.  Like all day or all week, if
> the user didn't quit.

You are still proceeding from the false, but common, assumption that window 
and document were the same entity, or even represented by the same object.  
(In part, the original design of JavaScript[tm] is to blame for that.) 

Instead, it is quite possible that code executed by window.setTimeout() or 
window.setInterval() does not have anything to do with the document resource 
that is displayed in one of the window's views (which is represented by the 
“document” property).

So what logical reason could there be not to continue executing it when that 
document resource is being navigated away from, unless the author of the 
document explicitly said so?

> It looks like you have given the answer I was looking
> for, although it's not what I wanted to hear.  So it
> goes.

A polite person would have said “thank you” at this point anyway.

And trimmed their quotes before.

<http://PointedEars.de/faq#posting> pp.

-- 
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