HighDots Forums  

how to turn off meta-refresh ?

Javascript JavaScript language (comp.lang.javascript)


Discuss how to turn off meta-refresh ? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: how to turn off meta-refresh ? - 10-19-2003 , 08:17 AM






Jim Ley wrote:
Quote:
[...] 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.
OK, that was exaggerated. It is not valid HTML 4.01 Strict.

Quote:
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,
ACK

Quote:
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.
Depends on what you call `work'. It will not work in Mozilla/5.0 and
IE 6 *as* *assumed*, because those user agents don't care what version
you specify there, they execute that code anyway. On the other hand,
IE 5 (which I can't test here) won't execute code that is within
language="JavaScript1.3" (or greater) as stated by Richard.

Quote:
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,
URL?

Quote:
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.
The first working draft of W3C-DOM Level 1 dates from about a year earlier,
09-Oct-1997.

Quote:
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) [...]
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.
Then I can use that property value as argument for window.clearTimeout(...)
without any problems. I could use `foobar' instead of `window' and it
will of course still work as long as `foobar' exists.

Quote:
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,
MyTinyBrowserWhichIWriteNow supports JavaScript, but
only HTML 3.2 for a faster Web experience. And now?

Quote:
There are no user agents supporting only HTML 3.2.
This is false by definition, there *must* *be* UAs supporting only HTML 3.2,
because HTML 4.0 dates from December 1999 (and -- because you go for dates
-- the first working draft that mentions event handlers from 17-Sep-1997).
They *may* *be* not of the recent ones, but they *exist* anyway.


PointedEars



Reply With Quote
  #22  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: how to turn off meta-refresh ? - 10-19-2003 , 08:30 AM






Richard Cornford wrote:
Quote:
"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.

Quote:
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.
ACK, that part was exaggerated.

Quote:
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.
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.

Quote:
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).
ACK, but `typeof' was implemented in JavaScript 1.1.


PointedEars



Reply With Quote
  #23  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: how to turn off meta-refresh ? - 10-19-2003 , 08:36 AM



Jim Ley wrote:
Quote:
[...] 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.
OK, that was exaggerated. It is not valid HTML *4* since the `type'
attribute is not `IMPLIED' in the HTML 4.01 DTD, neither Strict nor
Transitional.

Quote:
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,
ACK

Quote:
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.
Depends on what you call `work'. It will not work in Mozilla/5.0 and
IE 6 *as* *assumed*, because those user agents don't care what version
you specify there, they execute that code anyway. On the other hand,
IE 5 (which I can't test here) won't execute code that is within
language="JavaScript1.3" (or greater) as stated by Richard.

Quote:
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,
URL?

Quote:
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.
The first working draft of W3C-DOM Level 1 dates from about a year earlier,
09-Oct-1997.

Quote:
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) [...]
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.
Then I can use that property value as argument for window.clearTimeout(...)
without any problems. I could use `foobar' instead of `window' and it
will of course still work as long as `foobar' exists.

Quote:
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,
MyTinyBrowserWhichIWriteNow supports JavaScript, but
only HTML 3.2 for a faster Web experience. Therefore
it doesn't support the language-Attribute and not the
`onload' or any other intrinsic event handler. And now?

Quote:
There are no user agents supporting only HTML 3.2.
This is false by definition, there *must* *be* UAs supporting only HTML 3.2,
because HTML 4.0 dates from December 1999 (and -- because you go for dates
-- the first working draft that mentions event handlers from 17-Sep-1997).
They *may* *be* not of the recent ones, but they *exist* anyway.


PointedEars



Reply With Quote
  #24  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: how to turn off meta-refresh ? - 10-19-2003 , 08:38 AM



Richard Cornford wrote:
Quote:
"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.

Quote:
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.
ACK, but it's not valid HTML *4* at all if the `type' attribute is missing.

Quote:
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.
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.

Quote:
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).
ACK, but `typeof' was implemented in JavaScript 1.1.


PointedEars



Reply With Quote
  #25  
Old   
Jim Ley
 
Posts: n/a

Default Re: how to turn off meta-refresh ? - 10-19-2003 , 08:53 AM



On Sun, 19 Oct 2003 14:36:45 +0200, Thomas 'PointedEars' Lahn
<PointedEars (AT) web (DOT) de> wrote:

Quote:
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)

Quote:
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, and no browsers did implement, they just carried on being
bugwards compatible with the others.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/



Reply With Quote
  #26  
Old   
Jim Ley
 
Posts: n/a

Default Re: how to turn off meta-refresh ? - 10-19-2003 , 08:57 AM



On Sun, 19 Oct 2003 14:38:15 +0200, Thomas 'PointedEars' Lahn
<PointedEars (AT) web (DOT) de> wrote:

Quote:
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.
No, it's appropriate as 2 to contain all the information, not all
newsreaders are threading, not all news posters are threading and the
article may stand alone out of context from the header, there is
nothing inappropriate about 2 line citations.

Quote:
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.
Well given that you're posting fragments we neither know if you're
serving HTML 4 - or have used an internal subset to add in a default
value.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/



Reply With Quote
  #27  
Old   
Richard Cornford
 
Posts: n/a

Default Re: how to turn off meta-refresh ? - 10-19-2003 , 10:42 AM



"Thomas 'PointedEars' Lahn" <PointedEars (AT) web (DOT) de> wrote

Quote:
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". If
line means CR (&/|) LF terminated sequence of text I could make the
above into one line by just setting the margins in my news software to
110+ characters and apparently satisfy your criteria. I can see no
reason for doing that as the chances are that it would still be viewed
as two or more lines in most newsreader software, and even your 24
character attribution of me might be displayed across two lines if the
recipient had their viewing window set up sufficiently narrow (granted
that is unlikely).

You might just as easily stress "attribution" and consider what is
required to attribute. You and I may be using identifiers that are
unlikely to be confused with others but in the UK the name John Smith,
for example, is sufficiently common that one individual using that name
would not necessarily be distinguishable from another without an
accompanying email address (even if fake). And if you are going to say
that some individual wrote something it has got to be worth saying where
they wrote it, for which the message ID is probably the most
discriminating identifier available.

I can certainly see grounds for commenting on excessive (and irrelevant)
content in "attribution lines" but if you want to take the term that
literally can you justify loosing "attribution" for the sake of "line"?

<snip>
Quote:
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.

Quote:
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>
Quote:
ACK, but `typeof' was implemented in JavaScript 1.1.
And fortunately JavaScript 1.0 environments are no longer in use.

Richard.




Reply With Quote
  #28  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: how to turn off meta-refresh ? - 10-19-2003 , 12:45 PM



Jim Ley wrote:

Quote:
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.

Quote:
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,
Depends. As stated before, `window' and its properties are
part of the core JavaScript language up to version 1.3.

Quote:
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)
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.

Quote:
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, [...]
ACK


PointedEars



Reply With Quote
  #29  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: how to turn off meta-refresh ? - 10-19-2003 , 01:30 PM



Richard Cornford wrote:

Quote:
"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,
Grepping through the RFCs I have found no standard that supports that, but
that is not important at all. Parts of Son-of-RFC-1036, e.g., which one day
may *become* only a *draft* (maybe in this millenium ;-)) are already obeyed
by NetNews software, and RFC 1036 which an important base of NetNews calls
itself `Standard' but is not even on the IETFs standards track. Sum: Not
everything must be standardized to be reasonable and therefore acceptable.

Quote:
and your argument to date seems to hinge on stressing the word "line"
in "attribution line".
No, re-read my answer(s). It hinges on the easy readability of a posting/
thread which is a Good Thing. Header information included in the attribution
line that may be *someday* of use for *someone* doesn't compensate for a
more difficult following of a discussion, mentally ignoring superfluous
information when reading *now*.

Quote:
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.
I did not doubt that.

Quote:
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. -
?
No.

Quote:
That is not true.
I know, because `window' is the global object here -- as tests with
Netscape 3.0 to 7.1, IE 6 and Opera (all under Win2k) have proven.
But can you name a user agent where the global object is _not_ `window'
_and_ provides $globalObject.setTimeout/clearTimeout?

Quote:
snip
ACK, but `typeof' was implemented in JavaScript 1.1.

And fortunately JavaScript 1.0 environments are no longer in use.
How do you know for sure?


PointedEars



Reply With Quote
  #30  
Old   
Jim Ley
 
Posts: n/a

Default Re: how to turn off meta-refresh ? - 10-19-2003 , 01:33 PM



On Sun, 19 Oct 2003 18:45:39 +0200, Thomas 'PointedEars' Lahn
<PointedEars (AT) web (DOT) de> wrote:

Quote:
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.
Please stop wasting lines saying this, thanks.
Quote:
Depends. As stated before, `window' and its properties are
part of the core JavaScript language up to version 1.3.
So that would be relevant to precisely one user agent? (Netscape 4).

Generally we try and talk about all ECMAScript implementations now
commonly known as javascript here, otherwise life would be really very
dull.

Quote:
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.
Yep! They certainly do.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.