![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| ||||||||
| ||||||||
|
|
[...] Thomas 'PointedEars' Lahn [...] wrote: Jim Ley wrote: [...] Thomas 'PointedEars' Lahn [...] wrote: dan baker wrote: SCRIPT LANGUAGE="JavaScript1.1" That's invalid HTML, [...] [...] It's not even invalid HTML. |
|
in fact I don't know of any which won't (either taking it as their default type or understanding the language attribute) It's not even an IE invention, so I'm not sure where you got the idea. ,--------<http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.1>-------- | language = cdata [CI] | Deprecated. Yes, _deprecated_ not non-standard, |
|
it will only not work at all in non html user agents such as X-Smiles or SVG UA's. Of course then it would be ignored. |
|
it's a DOM object, although in effect "all" UA's less than 5 years old support it. Before the W3C-DOM (October 1998) there was no idea of a DOM, and what we call host objects of a DOM now were previously part of the core language. No they weren't Microsoft has always considered them distinct, |
|
it was only Netscape documentation that didn't. If you look at the CLJ FAQ from July 1998, you'll see that there's a question "What is the DOM" if it didn't exist until October, they're pretty f'ing prescient. |
|
There's no requirement that variables be part of a global object called window, [...] I also know of UA's which don't put their global variable as part of the window object and the above check would fail - I wouldn't recommend doing it) You are right, the proper way is window.myrefresh = window.setTimeout(...); No, that is not correct, for the same reasons I gave before (window does not _have_ to be the global object name) [...] |
|
Please name such a UA! The `onload' attribute was introduced in HTML 4.01, so all user agents supporting only HTML 3.2 will ignore it. No, Please name such a UA, |
|
There are no user agents supporting only HTML 3.2. |
#22
| ||||
| ||||
|
|
"Thomas 'PointedEars' Lahn" <PointedEars (AT) web (DOT) de> wrote in message news:3F9242BB.20803 (AT) PointedEars (DOT) de... |
|
Jim Ley wrote: [...] Thomas 'PointedEars' Lahn [...] wrote: dan baker wrote: SCRIPT LANGUAGE="JavaScript1.1" That's invalid HTML, [...] [...] ,----<http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.1>----- | language = cdata [CI] | Deprecated. ... Deprecated? So strictly it is only invalid HTML 4 Strict but still valid (if not recommended) in looser DTDs. |
|
if (window.myRefresh /* global variables are properties of the container object; no property, no clearing necessary */ There's no requirement that variables be part of a global object called window, [...] I also know of UA's which don't put their global variable as part of the window object and the above check would fail - I wouldn't recommend doing it) You are right, the proper way is window.myrefresh = window.setTimeout(...); I don't see the point of using references relative to - window - in this context. |
|
adding explicitely a property to the `window' object. Then the property can be checked for existence so that the timeout is only cleared if one has been set before. A type-converting-to-boolean test on an undeclared global identifier will produce errors where the same test on the property accessor of a non-existent global property will not, but typeof tests do not suffer the same problem so the property accessor syntax is not required when testing global properties/variables (just potentially useful under some circumstances). |
#23
| ||||||||
| ||||||||
|
|
[...] Thomas 'PointedEars' Lahn [...] wrote: Jim Ley wrote: [...] Thomas 'PointedEars' Lahn [...] wrote: dan baker wrote: SCRIPT LANGUAGE="JavaScript1.1" That's invalid HTML, [...] [...] It's not even invalid HTML. |
|
in fact I don't know of any which won't (either taking it as their default type or understanding the language attribute) It's not even an IE invention, so I'm not sure where you got the idea. ,--------<http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.1>-------- | language = cdata [CI] | Deprecated. Yes, _deprecated_ not non-standard, |
|
it will only not work at all in non html user agents such as X-Smiles or SVG UA's. Of course then it would be ignored. |
|
it's a DOM object, although in effect "all" UA's less than 5 years old support it. Before the W3C-DOM (October 1998) there was no idea of a DOM, and what we call host objects of a DOM now were previously part of the core language. No they weren't Microsoft has always considered them distinct, |
|
it was only Netscape documentation that didn't. If you look at the CLJ FAQ from July 1998, you'll see that there's a question "What is the DOM" if it didn't exist until October, they're pretty f'ing prescient. |
|
There's no requirement that variables be part of a global object called window, [...] I also know of UA's which don't put their global variable as part of the window object and the above check would fail - I wouldn't recommend doing it) You are right, the proper way is window.myrefresh = window.setTimeout(...); No, that is not correct, for the same reasons I gave before (window does not _have_ to be the global object name) [...] |
|
Please name such a UA! The `onload' attribute was introduced in HTML 4.01, so all user agents supporting only HTML 3.2 will ignore it. No, Please name such a UA, |
|
There are no user agents supporting only HTML 3.2. |
#24
| ||||
| ||||
|
|
"Thomas 'PointedEars' Lahn" <PointedEars (AT) web (DOT) de> wrote in message news:3F9242BB.20803 (AT) PointedEars (DOT) de... |
|
Jim Ley wrote: [...] Thomas 'PointedEars' Lahn [...] wrote: dan baker wrote: SCRIPT LANGUAGE="JavaScript1.1" That's invalid HTML, [...] [...] ,----<http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.1>----- | language = cdata [CI] | Deprecated. ... Deprecated? So strictly it is only invalid HTML 4 Strict but still valid (if not recommended) in looser DTDs. |
|
if (window.myRefresh /* global variables are properties of the container object; no property, no clearing necessary */ There's no requirement that variables be part of a global object called window, [...] I also know of UA's which don't put their global variable as part of the window object and the above check would fail - I wouldn't recommend doing it) You are right, the proper way is window.myrefresh = window.setTimeout(...); I don't see the point of using references relative to - window - in this context. |
|
adding explicitely a property to the `window' object. Then the property can be checked for existence so that the timeout is only cleared if one has been set before. A type-converting-to-boolean test on an undeclared global identifier will produce errors where the same test on the property accessor of a non-existent global property will not, but typeof tests do not suffer the same problem so the property accessor syntax is not required when testing global properties/variables (just potentially useful under some circumstances). |
#25
| |||
| |||
|
|
Jim Ley wrote: window.myrefresh = window.setTimeout(...); No, that is not correct, for the same reasons I gave before (window does not _have_ to be the global object name) [...] Read again. I create a new property for the `window' object and assign the result of window.setTimeout(...) which is in fact only an integer. |
|
There are no user agents supporting only HTML 3.2. This is false by definition, there *must* *be* UAs supporting only HTML 3.2, |
#26
| |||
| |||
|
|
Richard Cornford wrote: "Thomas 'PointedEars' Lahn" <PointedEars (AT) web (DOT) de> wrote in message news:3F9242BB.20803 (AT) PointedEars (DOT) de... Please shorten this to one line, thanks. |
|
Deprecated? So strictly it is only invalid HTML 4 Strict but still valid (if not recommended) in looser DTDs. ACK, but it's not valid HTML *4* at all if the `type' attribute is missing. |
#27
| ||||
| ||||
|
|
Richard Cornford wrote: "Thomas 'PointedEars' Lahn" <PointedEars (AT) web (DOT) de> wrote in message news:3F9242BB.20803 (AT) PointedEars (DOT) de... Please shorten this to one line, thanks. |
|
The whole point is that I check the variable/property before I am accessing it in the window.clearTimeout(...) call. |
|
Because of what Jim stated above I use the `window' object and create a new property, as for the timeout the `window' object is used anyway. |
|
ACK, but `typeof' was implemented in JavaScript 1.1. |
#28
| ||||
| ||||
|
|
On Sun, 19 Oct 2003 14:36:45 +0200, Thomas 'PointedEars' Lahn PointedEars (AT) web (DOT) de> wrote: |
|
Jim Ley wrote: window.myrefresh = window.setTimeout(...); No, that is not correct, for the same reasons I gave before (window does not _have_ to be the global object name) [...] Read again. I create a new property for the `window' object and assign the result of window.setTimeout(...) which is in fact only an integer. However you don't create the "window" object, so that's rather unsafe, |
|
which is my point, neither assmuing the global object is called window, nor assuming there is a window object is safe (I did mis-understand what you were intending the code to do - apologies) |
|
There are no user agents supporting only HTML 3.2. This is false by definition, there *must* *be* UAs supporting only HTML 3.2, No, because HTML 3.2 was written such that it described the existing behaviour of a variety of browsers, it wasn't a standard to be implemented, [...] |
#29
| ||||||
| ||||||
|
|
"Thomas 'PointedEars' Lahn" <PointedEars (AT) web (DOT) de> wrote in message news:3F9285B7.2050201 (AT) PointedEars (DOT) de... Richard Cornford wrote: "Thomas 'PointedEars' Lahn" <PointedEars (AT) web (DOT) de> wrote in message news:3F9242BB.20803 (AT) PointedEars (DOT) de... Please shorten this to one line, thanks. Why? You have been asked to cite a (any) Usenet standard that will support your request and so far you haven't, |
|
and your argument to date seems to hinge on stressing the word "line" in "attribution line". |
|
snip The whole point is that I check the variable/property before I am accessing it in the window.clearTimeout(...) call. Reasonable, but that could still be done with a typeof test. |
|
Because of what Jim stated above I use the `window' object and create a new property, as for the timeout the `window' object is used anyway. Are you saying that the setTimout/Interval call must follow - window. - ? |
|
That is not true. |
|
snip ACK, but `typeof' was implemented in JavaScript 1.1. And fortunately JavaScript 1.0 environments are no longer in use. |
#30
| |||
| |||
|
|
Jim Ley wrote: On Sun, 19 Oct 2003 14:36:45 +0200, Thomas 'PointedEars' Lahn PointedEars (AT) web (DOT) de> wrote: Please shorten this to one line, thanks. |
|
Depends. As stated before, `window' and its properties are part of the core JavaScript language up to version 1.3. |
|
I am using window.setTimeout(...) to set the timeout. Do the other user agents you know where the global object is not `window' provide $globalObject.setTimeout(...) and $globalObject.clearTimeout(...) with the same functionality? If not, this is merely of academical interest. |
![]() |
| Thread Tools | |
| Display Modes | |
| |