Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27284
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!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: Puzzling JS Error |
| Date | Fri, 10 Apr 2015 00:20:52 +0200 |
| Organization | PointedEars Software (PES) |
| Lines | 38 |
| Message-ID | <4117321.jCF6XAfRs9@PointedEars.de> (permalink) |
| References | <consduF625qU1@mid.individual.net> |
| 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 1428618179 3972 eJwNxskBwDAIA7CVEsAEj5PD7D9Cq5fgOfOuSGSg0f/ECNPx0hxeY6ntMXlCb9AK3nsn2wjpfgwiEO8= (9 Apr 2015 22:22:59 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Thu, 9 Apr 2015 22:22:59 +0000 (UTC) |
| User-Agent | KNode/4.14.2 |
| X-User-ID | eJwNysERACEIBLCWgFsWKEdQ+y/hnHzjH5UToBN+H845IUjFreotsUZiOknf1oo09JRNi+nO4gq1iHmFWNd/SjcVOQ== |
| Cancel-Lock | sha1:nlDyuAhmaL9H6I/4BK0kPlf2qdI= |
| X-NNTP-Posting-Host | eJwFwQkBwDAIA0BLZeGVQ2HxL6F3BhefUDdXo1EalahBBqf6cjfP/ti4qJhPnafVJuZQWPIAJZARcA== |
| Xref | csiph.com comp.lang.javascript:27284 |
Show key headers only | View raw
Mel Smith wrote:
> ****** fragment of Ajax set up code ********
>
> var HTTP;
> /*
> // problem in this next statement
> if (HTTP && (typeof HTTP !== "object" || HTTP.NAME)) {
> throw new Error("Namespace 'HTTP' already exists");
> }
> */
> alert("Ready toComplete Ajax set up.") ;
Please post *real* code.
With *this* code, the alert will be displayed because you have *commented
out* the offending code.
If we assume that you have not commented it out, there will never be thrown
an exception because, barring an assignment to “HTTP” earlier, the value of
the “HTTP” variable is the “undefined” value, the sole value of the
Undefined type, with which all variables are initialized if they are not
initialized explicitly.
“undefined“ is type-converted to boolean “false”, and shortcut evaluation of
a logical AND expression causes the remaining operands to be ignored if one
operand evaluates to “false” (because the result can never become “true” by
further evaluation).
Next time, before you post use the debugger that is nowadays built into
*all* Web browsers (by virtue of the most of them being based on WebKit,
Gecko or MSHTML); see the FAQ.
--
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
Puzzling JS Error "Mel Smith" <syntel@cox.net> - 2015-04-09 11:49 -0600
Re: Puzzling JS Error "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 22:21 +0200
Re: Puzzling JS Error "Mel Smith" <syntel@cox.net> - 2015-04-09 16:26 -0600
Re: Puzzling JS Error "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-10 10:32 +0200
Re: Puzzling JS Error Denis McMahon <denismfmcmahon@gmail.com> - 2015-04-10 14:51 +0000
Re: Puzzling JS Error "Mel Smith" <syntel@cox.net> - 2015-04-10 09:48 -0600
Re: Puzzling JS Error "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-04-10 18:01 +0200
Re: Puzzling JS Error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-10 00:20 +0200
Re: Puzzling JS Error JJ <jj4public@vfemail.net> - 2015-04-10 11:15 +0700
Re: Puzzling JS Error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-11 16:15 +0200
Re: Puzzling JS Error Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-04-11 18:09 -0300
Re: Puzzling JS Error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-11 23:42 +0200
Re: Puzzling JS Error Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-04-11 19:27 -0300
Re: Puzzling JS Error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-12 01:01 +0200
Re: Puzzling JS Error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-12 01:07 +0200
Re: Puzzling JS Error Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-04-11 22:07 -0300
csiph-web