missing ) after argument list

M

markarichman

Why is Firefox complaining with this error:

------------------------------------------------------------
missing ) after argument list

setTimeout('breakOut',5000);
------------------------------------------------------------

Here is the HTML that I'm producing:

<html>
<head>
<script type="text/javascript">
<!--
function breakOut() {
top.location.href = 'https://foo.com';
}
// -->
</script>
<body onLoad="setTimeout('breakOut()',5ØØØ);">
You have been logged out of the control panel due to inactivity for
your security.
</body>
</html>
 
L

Lee

(e-mail address removed) said:
Why is Firefox complaining with this error:

<body onLoad=3D"setTimeout('breakOut()',5=D8=D8=D8);">

Those characters are after the "5" are not zeros.
 
T

Thomas 'PointedEars' Lahn

Why is Firefox complaining with this error:

------------------------------------------------------------
missing ) after argument list

setTimeout('breakOut',5000);
------------------------------------------------------------

Here is the HTML that I'm producing:

<html>
<head>

<script type="text/javascript">
<!--
^^^^
Unnecessary and potentially harmful.
function breakOut() {
top.location.href = 'https://foo.com';

top.location = 'https://foo.com/';

is sufficient and not prone to the Same Origin Policy.
}
// --> ^^^^^^
Unnecessary.

</script>
<body onLoad="setTimeout('breakOut()',5ØØØ);">
^^^
This is not the zero ('0') character. ---'


PointedEars
 
M

markarichman

That worked!

Why are the <!-- //--> considered harmful? Aren't they supposed to help
JS-crippled browsers degrade?

- Mark
 
R

Randy Webb

(e-mail address removed) said the following on 12/14/2005 12:55 PM:
That worked!

Why are the <!-- //--> considered harmful? Aren't they supposed to help
JS-crippled browsers degrade?

They aren't harmful in an HTML document. They simply aren't needed is
all. There are no modern browsers that do not understand the script tag
and what to do with it in the absence of script. Whether that absence is
caused by disabling or the lack of script support at all.
 
T

Thomas 'PointedEars' Lahn

Why are the <!-- //--> considered harmful?

/Please/, ask Google (Groups) before you ask here. I am tired of explaining
that over and over again.
Aren't they supposed to help JS-crippled browsers degrade?

No. All UAs have to recognize the `script' element since HTML 3.2 and to
ignore it if not applicable.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Randy said:
(e-mail address removed) said the following on 12/14/2005 12:55 PM:
Why are the <!-- //--> considered harmful? Aren't they supposed to help
JS-crippled browsers degrade?

They aren't harmful in an HTML document. [...]

Wrong.


PointedEars
 
R

Randy Webb

Thomas 'PointedEars' Lahn said the following on 12/14/2005 2:27 PM:
/Please/, ask Google (Groups) before you ask here. I am tired of explaining
that over and over again.

Then obviously you are failing in your endeavors to pedantically explain it.

It is pedantic because it is irrelevant.
 
R

Randy Webb

Thomas 'PointedEars' Lahn said the following on 12/14/2005 2:41 PM:
Randy Webb wrote:

(e-mail address removed) said the following on 12/14/2005 12:55 PM:
Why are the <!-- //--> considered harmful? Aren't they supposed to help
JS-crippled browsers degrade?

They aren't harmful in an HTML document. [...]


Wrong.

Wrong again PointedHead. Unless of course you can name a modern browser
that with *Valid HTML* has a problem with it. Your move.

There is a very good reason why I wrote "in an HTML document".
 
M

Matt Kruse

Thomas said:
No. All UAs have to recognize the `script' element since HTML 3.2
and to ignore it if not applicable.

Your assumption is that everyone is using a browser which supports HTML 3.2
or higher.

While this may be a realistic assumption, in theory any user could be using
an ancient browser. And you like theory quite a bit.
 
V

VK

Matt said:
Your assumption is that everyone is using a browser which supports HTML 3.2
or higher.

While this may be a realistic assumption, in theory any user could be using
an ancient browser.

.... or have a personal reason to support an ancient browser. If I like
to have my page rendered nicely in NCSA Mosaic then why should it be
prohibited by anyone? - while supporting not too much younger IE 4.x is
supposed to be a valid (or even welcomed) action?

Also let do not mix the terms "harmful" and "not necessary".

<!-- --> tag is valid HTML comment tag since the first draft and till
now and for forever. (Unlike by the way [CDATA] block which is *XML
tag* and has nothing to do with HTML). So <!-- --> is no more "harmful"
than <html> or <body>

Is it necessary? - *Mostly* no. But if one likes to use it - let's not
make a crime from it. It is an overkill precaution, but no more
*criminal* or *overkill* then checking
if (document.getElementById)
The chances to be useful in both cases are equal (somewhere around
0.001%) but still above zero.
 
T

Thomas 'PointedEars' Lahn

Matt said:
Your assumption is that everyone is using a browser which supports HTML
3.2 or higher.

While this may be a realistic assumption, in theory any user could
be using an ancient browser. And you like theory quite a bit.

Both in theory and in practice, RFC2854 as of June 2000 (that is 5 years
and 6 months ago), obsoletes _all_ HTML versions prior to 3.2 (which was
introduced on January 14, 1997, 9 years and 11 months ago!), hence
obsoletes all pre-3.2 UAs (which would not be usable today anyway). And
even if there were such an obsolete UA still in use (which includes that
it would need to be usable on current operating systems and hardware), it
would not (be allowed to) render content within the `head' element as that
has not changed since HTML 1.0.

I am completely sure I mentioned that before.

BTW: A nice resource I have found is
<URL:http://www.yourhtmlsource.com/starthere/historyofhtml.html>


PointedEars
 
L

Lee

VK said:
Is it necessary? - *Mostly* no. But if one likes to use it - let's not
make a crime from it. It is an overkill precaution, but no more
*criminal* or *overkill* then checking
if (document.getElementById)
The chances to be useful in both cases are equal (somewhere around
0.001%) but still above zero.

Using the comments is more likely to cause problems than to
prevent them.

They introduce another chance to mistype something.
In some browsers, the line:
-->
is a syntax error (unary negation and test if greater than,
with no operands). On balance, I continue to recommend not
using them.
 
T

Thomas 'PointedEars' Lahn

VK said:
Also let do not mix the terms "harmful" and "not necessary".

<!-- --> tag is valid HTML comment tag since the first draft and till now
and for forever.

Nonsense! `<!' introduces an SGML declaration, `--' starts and ends a
comment within an SGML declaration, and `>' ends the declaration. It
is basically `<!>' to an SGML parser, an empty declaration. Everything
else is tag soup behavior that cannot be assumed. Which is why Mozilla/5.0
(Unlike by the way [CDATA] block which is *XML tag*

Nonsense! CDATA (Character DATA) is an SGML data type and it is possible
to declare data CDATA using the respective declaration in XML, which is an
SGML subset:

<![CDATA[
This is declared CDATA content if it was not CDATA
]]>
and has nothing to do with HTML).

Which is why it is harmful in XHTML, too.
So <!-- --> is no more "harmful" than <html> or <body>

Within CDATA, which is BTW the _default_ for the content of the `script'
element in HTML, '<!-- ... -->' is _not_ an empty declaration which is why
an SGML parser would pass it to the script engine could be passed it as-is
which would be a syntax error. As neither a HTML UA nor a script engine
is required to ignore that, the label "potentially harmful" is justified.

Even if the voices in your head tell something different.

Sigh. [psf 10.1]


PointedEars
 
V

VK

Thomas said:
Nonsense! `<!' introduces an SGML declaration,

What in the holly name any SGML issues have to do with someting loaded
as "text/html" content type?

But I'm glad you brought some twilight "shining" on this question. Now
I will never use any doctype declarations and I will stop *anyone* from
suggesting them. Really: how can we imply a desclaration written with
brute violation of ... uhm... *SGML* standards plus potentially
*harmful*?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

where:
<http://www.w3.org/TR/html4/strict.dtd>

....
<!--====== Imported Names ==========-->
.... etc.


DOCTYPE - simply say NO!
 
T

Thomas 'PointedEars' Lahn

VK said:
What in the holly name any SGML issues have to do with someting loaded
as "text/html" content type?

Because HTML is an SGML application. If you had read _any_ HTML Spec,
you would have known.
But I'm glad you brought some twilight "shining" on this question. Now
I will never use any doctype declarations and I will stop anyone from
suggesting them.

That is typical of you. Why avoid mistakes when it is possible to mask
them and get away with it? You are nothing but a poser, and your advice
is harmful or potentially harmful most of the time. Go away.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Patient said:
Thomas 'PointedEars' Lahn said:
Nonsense! `<!' introduces an SGML declaration, `--' starts and ends a
comment within an SGML declaration, and `>' ends the declaration. It
is basically `<!>' to an SGML parser, an empty declaration.
Everything else is tag soup behavior that cannot be assumed. Which is
why Mozilla/5.0 will not consider <!------> a closed comment in Strict
Mode and does not render the adjacent markup.

What a load of unadulterated bandwidth waste yet again from you!!!
[...]
[from http://www.w3.org/TR/REC-html40/intro/sgmltut.html]

| 3.2 SGML constructs used in HTML
|
| The following sections introduce SGML constructs that are used in HTML.
| [...]
3.2.4 Comments

HTML comments have the following syntax:

<!-- this is a comment -->
<!-- and so is this one,
which occupies more than one line -->

White space is not permitted between the markup declaration open
delimiter("<!") and the comment open delimiter ("--"), but is permitted
between the comment close delimiter ("--") and the markup declaration
close delimiter (">"). A common error is to include a string of hyphens
("---") within a comment. Authors should avoid putting two or more
adjacent hyphens inside comments.
[...]

Now where is the contradiction, you address-munging, namespace-spoiling,
top-posting fool?


PointedEars
 
P

Patient Guy

Patient said:
Thomas 'PointedEars' Lahn said:
VK wrote:
Also let do not mix the terms "harmful" and "not necessary".
<!-- --> tag is valid HTML comment tag since the first draft and
till now and for forever.

Nonsense! `<!' introduces an SGML declaration, `--' starts and ends
a comment within an SGML declaration, and `>' ends the declaration.
It is basically `<!>' to an SGML parser, an empty declaration.
Everything else is tag soup behavior that cannot be assumed. Which
is why Mozilla/5.0 will not consider <!------> a closed comment in
Strict Mode and does not render the adjacent markup.

What a load of unadulterated bandwidth waste yet again from you!!!
[...]
[from http://www.w3.org/TR/REC-html40/intro/sgmltut.html]

| 3.2 SGML constructs used in HTML
|
| The following sections introduce SGML constructs that are used in
| HTML. [...]
3.2.4 Comments

HTML comments have the following syntax:

<!-- this is a comment -->
<!-- and so is this one,
which occupies more than one line -->

White space is not permitted between the markup declaration open
delimiter("<!") and the comment open delimiter ("--"), but is
permitted between the comment close delimiter ("--") and the
markup declaration close delimiter (">"). A common error is to
include a string of hyphens ("---") within a comment. Authors
should avoid putting two or more adjacent hyphens inside comments.
[...]

Now where is the contradiction

Poster VK: <!-- --> tag is valid HTML comment tag since the first draft
and till now and for forever.

You: Nonsense! `<!' introduces an SGML declaration, `--' starts
and ends a comment within an SGML declaration, and `>' ends
the declaration.

W3 document: HTML comments have the following syntax:
<!-- this is a comment -->


Now what was hard about following that?

, you address-munging,

the address I gave was an obvious attempt at humor....
namespace-spoiling,

Okay...I give up...what are you trying to say here?
top-posting

It would be true had I really in truth top-posted. But all my responses,
interspersed or otherwise, were placed BELOW the text they were responding
to.

But then you already knew that....

Well, I have to admit that even I can occasionally be wrong and humbled.
Even by the likes of you.

The question before us is whether you have ever admitted to being wrong
and/or humbled, irrespective of the fact that you have been wrong and
humbled at times.
 
V

VK

Duncan said:
You missed another bit of the HTML standard:

W3 document: HTML 4 is an SGML application conforming to International
Standard ISO 8879 -- Standard Generalized Markup Language SGML (defined in
[ISO8879]).

and SGML defines a comment declaration differently than HTML.

So the question is which definition of a comment do you believe? The one
you quoted is a 'discussion' and therefore it is reasonable to assume it is
not normative. If taken literally it implies that HTML comments must
contain the text 'this is a comment', or 'and so is this one, which
occupies more than one line' so it is obvious that the statement 'HTML
comments have the following syntax' is wrong: they are giving some
examples, not specifying syntax. For the actual comment syntax you have to
fall back on the SGML standard.

You guys are something else...

You serve a page with MIME type "text/html"
You even link DTD document in the header in case if "some browser"
doesn't know how to tread <table> or <body> or comment tags.
But you are still all in worry that something can go wrong and browser
may read the source as pure SGML. The only solution you see by not
using anything of SGML, or better do not use any tags at all....

Sorry for you but please keep beginners out of discovers like "HTML
comments are harmful" or "textarea doesn't have and never had WRAP
property" etc. (WRAP property indeed doesn't exists by W3C).

Stop reading W3C obscure crap, get some fresh air and make a couple of
real world web-projects (best of all - for money). You'll come back as
all new better people, trust me.
:)

P.S.
<quote>
<http://www.w3.org/MarkUp/html-spec/html-spec_3.html#SEC3.2.5>
To include comments in an HTML document, use a comment declaration.

A comment declaration consists of `<!' followed by zero or more
comments followed by `>'.

Each comment starts with `--' and includes all text up to and including
the next occurrence of `--'.

In a comment declaration, white space is allowed after each comment,
but not before the first comment.

The entire comment declaration is ignored.
</quote>
 
T

Thomas 'PointedEars' Lahn

You call that line part of an attempt at constructive discussion?
Then do not be astonished by the replies you get for this.

| 3.2 SGML constructs used in HTML
|
| The following sections introduce SGML constructs that are used in
| HTML. [...]
3.2.4 Comments

HTML comments have the following syntax:

<!-- this is a comment -->
<!-- and so is this one,
which occupies more than one line -->

White space is not permitted between the markup declaration open
delimiter("<!") and the comment open delimiter ("--"), but is
permitted between the comment close delimiter ("--") and the
markup declaration close delimiter (">"). A common error is to
include a string of hyphens ("---") within a comment. Authors
should avoid putting two or more adjacent hyphens inside comments.
[...]

Now where is the contradiction

Poster VK: <!-- --> tag is valid HTML comment tag since the first draft
and till now and for forever.

You: Nonsense! `<!' introduces an SGML declaration, `--' starts
and ends a comment within an SGML declaration, and `>' ends
the declaration.

W3 document: HTML comments have the following syntax:
<!-- this is a comment -->

Where you omit conveniently that the HTML Specification says nothing
different than I did, in fact, is says exactly the same as I did, while
it proves VK wrong.
Now what was hard about following that?

`<!-- -->' is _not_ a "comment tag". It is an empty SGML declaration which
is parsed only as such in _PCDATA_ (Parsed Character DATA) content. The
`script' element's content, however, is CDATA in HTML. Therefore, every
standard HTML parser (that is, not a "tag soup" parser) will pass it
as-is to the script engine. The standard for script engine behavior, on
the other hand, is ECMAScript, where `<', `!' and `--' are defined as
_operators_. Occurrences of these operators without the respective
number of operands are a SyntaxError and will break the script.

Neither can it be safely assumed that a "tag soup" parser is used to parse
HTML nor can it be safely assumed that an ECMAScript compliant script
engine (and _all_ currently implemented script engines are ECMAScript
compliant) ignores operators just because they are arranged in a manner
that resembles delimiters of a _markup_ language.

Therefore, and because there is no usable UA left that does not support
(in terms of "recognize, and ignore if not applicable") the respective
feature of HTML 3.2 (which turns 10 next month), it is unnecessary and
potentially harmful to use those delimiters within the HTML `script'
element.

And because in XHTML the content model of the `script' element is PCDATA by
default, using comment delimiters there would most certainly result in an
empty `script' element. Properties that are supposed to be declared
there will not be declared and for example method calls referring to that
commented code will result in a ReferenceError and break the script. (And
if the content was declared CDATA using the respective XML declaration as
e.g. VK mentioned, it would be handled as in HTML, with an even greater
probability of failure as XHTML is an XML application which must adhere
to well-formedness.) Therefore, it is potentially harmful to use comment
delimiters within the `script' element in XHTML, too.

Which leaves us with the conclusion that SGML comment delimiters within
the `script' element are unnecessary and potentially harmful. Which is
in sharp contrast to VK's statement.
Okay...I give up...what are you trying to say here?

You do not own the domain found.com, that is found.com, Inc. (as your
favorite WHOIS service tells you), which will also receive either all
the spam mails directed to your From header "address" or rather the
error messages about the non-existing mail account. Continued use by
you is domain abuse, a form of Network abuse disallowed by section 5
of your NetNews service provider's Posting policy and most certainly
by your Internet Service Provider's Terms of Use.

And if found.com would not be registered, anyone registering it later
will receive either that spam or the error messages, so that would not
make much of a difference.


Nuff said.

PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top