IE7 returns "unknown" instead of "undefined" when querying the type of
an unknown property of an object, for example
document.write(typeof window.missingproperty);
Has "unknown" been defined as a valid return value for the typeof
operator in a later version of ECMAScript or is this a JScript "feature"?
--
Klaus Johannes Rusch Kl********@atmedia.net http://www.atmedia.net/KlausRusch/ 9 10588
Klaus Johannes Rusch wrote:
>
IE7 returns "unknown" instead of "undefined" when querying the type of
an unknown property of an object, for example
document.write(typeof window.missingproperty);
Has "unknown" been defined as a valid return value for the typeof
operator in a later version of ECMAScript or is this a JScript "feature"?
No to ECMAScript, yes to JScript - Microsoft added it to version 8,
along with 'date'.
--
Rob
JRS: In article <4i************@individual.net>, dated Wed, 26 Jul 2006
00:06:37 remote, seen in news:comp.lang.javascript, Klaus Johannes Rusch
<Kl********@atmedia.netposted :
> IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example
document.write(typeof window.missingproperty);
Has "unknown" been defined as a valid return value for the typeof operator in a later version of ECMAScript or is this a JScript "feature"?
It is bad to set follow-up without a note in the body; "FU set"
suffices. FU overridden.
My pages use such as
if (typeof(Inc1T)=='undefined') alert('File include1.js top fault, RSVP!')
with Inc1T=0 being defined at the top of file include1.js.
If this rather stupid change is confirmed, are there any suggestions for
alternatives to the above statement - preferably no longer, unlike
if ((typeof Inc1T).charAt(0)=='u') alert('File include1.js top fault, RSVP!')
?
FU set.
Read the newsgroup FAQ.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Dr John Stockton said the following on 7/26/2006 8:42 AM:
JRS: In article <4i************@individual.net>, dated Wed, 26 Jul 2006
00:06:37 remote, seen in news:comp.lang.javascript, Klaus Johannes Rusch
<Kl********@atmedia.netposted :
>IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example
document.write(typeof window.missingproperty);
Has "unknown" been defined as a valid return value for the typeof operator in a later version of ECMAScript or is this a JScript "feature"?
It is bad to set follow-up without a note in the body; "FU set"
suffices. FU overridden.
You are starting to act like TL. It is not bad set it without a note, it
is bad to set it at all on the original post. If the OP can figure out
where to set follow-up to then they should only post there as follow-up
is generally set to the most appropriate group.
My pages use such as
if (typeof(Inc1T)=='undefined') alert('File include1.js top fault, RSVP!')
with Inc1T=0 being defined at the top of file include1.js.
Why typeof? Why not just if(Inc1T). Depending on how Inc1T is defined
though.
If this rather stupid change is confirmed,
It is not a "stupid change", it actually makes sense.
are there any suggestions for
alternatives to the above statement - preferably no longer, unlike
if ((typeof Inc1T).charAt(0)=='u') alert('File include1.js top fault, RSVP!')
if (Inc1T)
But, it depends on how "unknown" gets translated to a Boolean. Does it
type convert to true or false?
Read the newsgroup FAQ.
For what reason in this post should they read the FAQ? Or is that your
new template?
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Answer:It destroys the order of the conversation
Randy Webb wrote:
Dr John Stockton wrote:
>Johannes Rusch wrote:
>>IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example
document.write(typeof window.missingproperty);
<snip>
>If this rather stupid change is confirmed,
It is not a "stupid change", it actually makes sense.
<snip>
If true, that all non-provided properties of the global/window object in
IE would report "unknown" when tested with the - typeof - operator, then
it would be a monumentally stupid modification for Microsoft to make to
in IE 7. It would probably kill 10% of browser scripts at a stroke.
Indeed it is such a stupid thing for Microsoft to have done that it is
extremely unlikely that they have done this, and instead it is the case
that the OP is misinterpreting whatever evidence he thinks he has for
this.
Defined properties of ActiveX objects, and some parts of the IE browser
object model, sometimes do return 'unknown' from typeof, so some poorly
selected property names may well produce the illusion of the effect
described. However, I have tested the substantial web application that I
am currently working on in IE 7 and encountered no significant issues
with it, and I cannot believe that in 60,000 lines of code there are no
typeof tests for non-'undefined' of global properties (even if none
spring to mind at the moment).
Richard.
Richard Cornford wrote:
Randy Webb wrote:
Dr John Stockton wrote:
Johannes Rusch wrote: IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example
document.write(typeof window.missingproperty);
<snip>
If this rather stupid change is confirmed,
It is not a "stupid change", it actually makes sense.
<snip>
If true, that all non-provided properties of the global/window object in
IE would report "unknown" when tested with the - typeof - operator, then
it would be a monumentally stupid modification for Microsoft to make to
in IE 7. It would probably kill 10% of browser scripts at a stroke.
Indeed it is such a stupid thing for Microsoft to have done that it is
extremely unlikely that they have done this, and instead it is the case
that the OP is misinterpreting whatever evidence he thinks he has for
this.
Here's what I found in the JScript 8 Reference on MSDN:
<URL: http://msdn2.microsoft.com/en-us/library/d70y8358.aspx
>
Unfortunately, I can't find where they define the 'unkown' type, their
summary of data types is here (it doesn't mention unkown, undefined,
null...)
<URL: http://msdn2.microsoft.com/en-us/library/hhw1f6w5.aspx >
Defined properties of ActiveX objects, and some parts of the IE browser
object model, sometimes do return 'unknown' from typeof, so some poorly
selected property names may well produce the illusion of the effect
described. However, I have tested the substantial web application that I
am currently working on in IE 7 and encountered no significant issues
with it, and I cannot believe that in 60,000 lines of code there are no
typeof tests for non-'undefined' of global properties (even if none
spring to mind at the moment).
It would be nice to know from MS themselves how 'unknown' should
behave.
--
Rob
RobG wrote:
<snip>
It would be nice to know from MS themselves how 'unknown' should
behave.
the resulting value is Undefined, and typeof undefined is 'undefined'
so either Microsoft have seriously crippled compatibility with ECMA <=
3rd Ed. (so cross-browser compatibility in general) or the symptoms
have been miss-reported/identified. I may have time to try this myself
on IE 7 this afternoon.
Richard.
Richard Cornford wrote:
If true, that all non-provided properties of the global/window object in
IE would report "unknown" when tested with the - typeof - operator, then
it would be a monumentally stupid modification for Microsoft to make to
in IE 7. It would probably kill 10% of browser scripts at a stroke.
Indeed it is such a stupid thing for Microsoft to have done that it is
extremely unlikely that they have done this, and instead it is the case
that the OP is misinterpreting whatever evidence he thinks he has for
this.
Defined properties of ActiveX objects, and some parts of the IE browser
object model, sometimes do return 'unknown' from typeof,
I have made a test case
<http://home.arcor.de/martin.honnen/javascript/typeofTest1.html>
and it shows no difference in terms of 'unknown' results for me between
IE 6 and IE 7 beta 3. Only testing typeof on a property/method of an
ActiveX object gives 'unknown' and that has been known (pun intended)
before IE 7.
And ECMAScript edition 3 (11.4.3 The typeof Operator) for host objects
and typeof says
"Object (host) Implementation-dependent"
so an implementation is allowed to yield something different than the
predefined values 'undefined', 'number', 'boolean', 'string', 'object',
and 'function' in this case.
--
Martin Honnen http://JavaScript.FAQTs.com/
JRS: In article <44c75b61$0$23525$5a62ac22@per-qv1-newsreader-
01.iinet.net.au>, dated Wed, 26 Jul 2006 22:07:39 remote, seen in
news:comp.lang.javascript, RobG <rg***@iinet.net.auposted :
>Klaus Johannes Rusch wrote:
>> IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example
document.write(typeof window.missingproperty);
Has "unknown" been defined as a valid return value for the typeof operator in a later version of ECMAScript or is this a JScript "feature"?
No to ECMAScript, yes to JScript - Microsoft added it to version 8, along with 'date'.
I wonder whether IE7 counts my Inc1T as being an unknown property of an
object, if the include file defining it is not found?
From the FAQ, I take it that the term JScript includes the scripting
language in Microsoft's Web browsers.
<FAQENTRYISTM that, in the FAQ, it would be useful to have an
indication of the differences between JScript and ECMA-232 3rd Edn -
probably as an example entry with a link to Notes or elsewhere.
JScript "unknown" and "date" might be a good example.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
JRS: In article <X_******************************@comcast.com>, dated
Wed, 26 Jul 2006 15:34:21 remote, seen in news:comp.lang.javascript,
Randy Webb <Hi************@aol.composted :
>Dr John Stockton said the following on 7/26/2006 8:42 AM:
>JRS: In article <4i************@individual.net>, dated Wed, 26 Jul 2006 00:06:37 remote, seen in news:comp.lang.javascript, Klaus Johannes Rusch <Kl********@atmedia.netposted :
>>IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example
document.write(typeof window.missingproperty);
Has "unknown" been defined as a valid return value for the typeof operator in a later version of ECMAScript or is this a JScript "feature"?
>My pages use such as if (typeof(Inc1T)=='undefined') alert('File include1.js top fault, RSVP!') with Inc1T=0 being defined at the top of file include1.js.
Why typeof? Why not just if(Inc1T). Depending on how Inc1T is defined though.
Evidently you have once more incorrectly assumed understanding on your
own part. Depending on circumstances, either Inc1T is defined or it is
not defined; TINA. If it's defined, all is (so far) well; no alert is
required. Its value is not used.
If it is not defined, I want to give my own specific recognisable
warning; I don't want the general use-of-undefined warning since that
could occur for other reasons elsewhere in the code : remember, this is
a Web application, so messages can be read by those other than the
author.
>If this rather stupid change is confirmed,
It is not a "stupid change", it actually makes sense.
Had it been introduced at the birth of Javascript, using "unknown" would
have been slightly better than using "undefined"; but to make such a
change, when in ECMA-263 3rd Edn "undefined" is defined and "unknown"
does not appear, is either ludicrous or a malicious commercial move.
Changing the set of results possible from typeof is unnecessary; it is
sufficient to have a new feature getType which returns the fuller
detail.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Charles Crume |
last post by:
Hello;
My "index.htm" page has 3 frames (content, navigation bar, and logo).
I set the "SRC" of the "logo" frame to a blank gif image and then want to
change it's contents after the other two...
|
by: Irakl Gordin |
last post by:
this.opener is not null but everything inside it is "uknown". How should
I interpret it?
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
|
by: Roland |
last post by:
Hello,
the example code is the following(the number in parentheses at the
beginning are just for reference)(The complete HTML file is at the end
of this article):
(1)window.location =...
|
by: Paul T. Rong |
last post by:
Do "" and Null both mean nothing?¡¡
If I don't type anything in text box, the its value is Null£¿¡¡Or it is ¡°¡±£¿
I don¡¯ think they are the same, but I don¡¯t know their difference. Thanks.
|
by: David Cleaver |
last post by:
Hello all,
I was wondering if there were some sort of limitations on the "if"
statement? I'm writing a program which needs to check a bunch of
conditions all at the same time (basically). And...
|
by: infobahn |
last post by:
printf("%p\n", (void *)0); /* UB, or not? Please explain your answer. */
|
by: jccorreu |
last post by:
I've got to read info from multiple files that will be given to me. I
know the format and what the data is. The thing is each time we run
the program we may be using a differnt number of files,...
|
by: Aaron |
last post by:
I'm trying to parse a table on a webpage to pull down some data I
need. The page is based off of information entered into a form. when
you submit the data from the form it displays a...
|
by: Prisoner at War |
last post by:
Hi, People,
Is it possible to have an "empty" or "dummy" <a href***without***
the browser jumping back up the page??
I have a hyperlink that doesn't point to another document, but is used
to...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |