Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #24161
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: intercept an alert |
| Date | Mon, 12 May 2014 19:35:35 +0200 |
| Organization | PointedEars Software (PES) |
| Lines | 43 |
| Message-ID | <10627210.CkprS3AAyM@PointedEars.de> (permalink) |
| References | <862dneogqrcsze3OnZ2dnUVZ_gCdnZ2d@westnet.com.au> <raKdnSsnnK2Ow-3OnZ2dnUVZ_sadnZ2d@westnet.com.au> <3910370.hJEAF5dPUy@PointedEars.de> <8761lb47e7.fsf@gmail.com> <XnsA32B97AB9DD2Ceejj99@194.109.133.133> <window-20140512151357@ram.dialup.fu-berlin.de> |
| Reply-To | Thomas 'PointedEars' Lahn <cljs@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 8Bit |
| X-Trace | solani.org 1399916137 3888 eJwFwYkRwDAIA7CVeGyTjhO4sP8IlZhyTUEUuFyPtGAN+Pbr9URcfz1QH/O20QGUXpfX3sQPCZoQgw== (12 May 2014 17:35:37 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Mon, 12 May 2014 17:35:37 +0000 (UTC) |
| User-Agent | KNode/4.12.4 |
| X-User-ID | eJwFwYEBwDAEBMCVKjx+nCD2H6F3UBfvMIcbFpvtm3Mwug/Uibbae4hqI0uStxrCKs3NfHgadPSnHNHAD2mpFZA= |
| Face | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9w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BrHETeP4JbGCaKjoCHQuw3Tbuzq621grt0Um8hS8y84x7HcBiJww9EAxHY |
| Xref | csiph.com comp.lang.javascript:24161 |
Show key headers only | View raw
Stefan Ram wrote:
> "Evertjan." <exxjxw.hannivoort@inter.nl.net> writes:
>> Simon Lewis […] wrote […]:
>>> People tag things on to "window" in each and every JS project.
>> You cannot know my JS projects, nor that of my neighbours,
>> so such utterances make your js-credulity go below 1% here.
>
> When one just defines a global function (which happens
> often) or variable, it becomes a property of the windows
> object.
You meant _window_, and no. It becomes a property of the ECMAScript global
object with the attribute [[DontDelete]] (ES3) or lacking the [[Writable]]
attribute (ES5.1+); see ES 5.1, §§10.2.3 and 10.4.1 [0]. Anything more
depends on the runtime environment and is not reliable (cross-frame
referencing excluded).
The ECMAScript global object can be referred to in the global execution
context with “this” because it is its /this/ value. Since there is no other
standards-compliant way, particularly not a built-in property, to refer to
the global object (yet) (returning the “this” value from an instantly called
anonymous function does not work in strict mode), it is recommended to
define a variable or property that can be used instead. For example:
var _global = this;
JSX provides “jsx.global” since several revisions in order to avoid another
global variable. [1] (The main compatibility layer, JSX:compat.js, can
still provide the old “_global” if needed. [2]) Of course, in properly
structured code it is only seldom necessary to refer to the global object
from local context in the first place.
____________
[0] <http://ecma-international.org/ecma-262/5.1/#sec-10.2.3>
<http://ecma-international.org/ecma-262/5.1/#sec-10.4.1>
[1] <http://PointedEars.de/wsvn/JSX/trunk/object.js>
[2] <http://PointedEars.de/wsvn/JSX/trunk/compat.js>
--
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
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
intercept an alert Andrew Poulos <ap_prog@hotmail.com> - 2014-05-12 14:38 +1000
Re: intercept an alert Andrew Poulos <ap_prog@hotmail.com> - 2014-05-12 15:35 +1000
Re: intercept an alert Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-12 11:32 +0200
Re: intercept an alert Simon Lewis <simonlewis2001@gmail.com> - 2014-05-12 12:29 +0200
Re: intercept an alert Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-12 13:30 +0200
Re: intercept an alert "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-05-12 14:54 +0200
Re: intercept an alert "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-05-12 15:36 +0200
Re: intercept an alert Simon Lewis <simonlewis2001@gmail.com> - 2014-05-12 15:40 +0200
Re: intercept an alert Simon Lewis <simonlewis2001@gmail.com> - 2014-05-12 15:43 +0200
Re: intercept an alert "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-05-12 16:19 +0200
Re: intercept an alert Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-12 19:35 +0200
Re: intercept an alert garrett.smith@acxiom.com - 2014-05-14 09:57 -0700
Re: intercept an alert Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-05-13 18:00 +0100
Re: intercept an alert garrett.smith@acxiom.com - 2014-05-14 09:57 -0700
csiph-web