473,799 Members | 3,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

missing ) after argument list

Why is Firefox complaining with this error:

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

setTimeout('bre akOut',5000);
------------------------------------------------------------

Here is the HTML that I'm producing:

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

Dec 14 '05
69 16900
VK

Michael Winter wrote:
No, as usual Firefox is correct (as far as the W3C DOM is concerned).
The tagName property is defined only for elements (objects implementing
the Element interface). Whilst a Comment is a Node (it inherits from
CharacterData), it is not an Element and therefore possesses only the
node* properties.


I guess PointedEars has moved something in my unstable brains so I
become like a documentation fighter :-) Just for a while! :-)

<!> tag has nothing to do with comments, it's a tag like any others: it
has name "!", it can have attributes.

--Comment block inside-- *is* #comment node with the node properties
only (no element properties).

Dec 21 '05 #61
On 21/12/2005 20:51, VK wrote:

[snip]
<http://www.w3.org/MarkUp/html-spec/html-spec_3.html#SEC 3.2.5>
HTML 2.0 is obsolete, so it shouldn't be considered a normative
reference. Unless SGML states that a comment value includes the closing
delimiter (and I don't own a copy of ISO 8879), then I'll assume that
the idea was revised.

In any case, as far as the W3C DOM is concerned, a comment is delimited
by, but does not include, a pair of hyphens.

[snip]
I recently came across a Microsoft document that contained
something like:

<!------->

and Firefox promptly ignored everything after that until it came
across something similar later.


Uuhm.... What Firefox did you use?


Fx 1.0.7, but that hardly matters. Not all user agents take a simple
approach to comments.

From some quick further reading[1], it seems that this is a 'Quirks'
versus 'Standards' mode issue, which I can confirm.
Firefox 1.5 DOM Inspector shows correctly
Correctly?
#comment node [...]
Because your test triggered 'Quirks' mode, perhaps?

[snip]
In any case, it is undoubtely safer to take the XML approach: comments
start with '<!--', end with '-->' ('--->' is forbidden), and should
never include paired hyphens ('--').


There is not XML approach: there is SGML approach common for both HTML
and XML [...]


You misunderstand both my point, and the facts. As we know, SGML
delimits comments with '--' inside many types of markup declaration.
However in XML, comments may /only/ appear as I described above. My
point: it is a safe formulation to use, so that's what I'd recommend.

[snip]
Therefore <!-- Comment 1-- -- Comment 2-- -- Comment 3--
id="myComment" >
[snip]
(comments are allowed to have attributes btw - but because of broken
implementation one cannot use this ability).


Absolute rubbish. Try validating that with an SGML parser.

[snip]

Mike
[1] <http://www.howtocreate .co.uk/sgml/doctypeSGML.htm l>

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 21 '05 #62
On 21/12/2005 23:13, VK wrote:
Michael Winter wrote:
No, as usual Firefox is correct (as far as the W3C DOM is concerned).
The tagName property is defined only for elements (objects implementing
the Element interface). Whilst a Comment is a Node (it inherits from
CharacterData), it is not an Element and therefore possesses only the
node* properties.

[snip]
<!> tag has nothing to do with comments,
Where, above, did I say it did?
it's a tag like any others:
No it isn't. It is a markup declaration open delimiter, immediately
followed by a markup declaration close delimiter. In the SGML grammar,
that matches a comment declaration (the actual comment is optional).
it has name "!", it can have attributes.


Utter nonsense.

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 22 '05 #63
VK
On 21/12/2005 23:13, VK wrote:
<!> tag has nothing to do with comments
Michael Winter wrote:
Where, above, did I say it did?


That's gonna be my MD work "Philosophi e of Comments in Modern Browsers"
:-)

<!> *is* an equivalent of comment tag - no "--" needed. I don't know
when did it happen by I guess it was made to keep the display out of
ASP / JSP / PHP tags
Tested on IE 6.0, FF 1.5, Opera 8.51

// CODE FOR FUN BELOW //

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Commen t</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">

<script type="text/javascript">
function test() {
var out = document.forms[0].elements[0];
out.value = '';
var coms = document.getEle mentsByTagName( '!');
for (p in coms[1]) {out.value+= p+' = '+coms[1][p]+'\n';}
}
</script>

</head>

<body onload="test()" >
<form method="post" action="">
<textarea name="out" cols="64" rows="16"></textarea>
</form>
<! My comment />
</body>
</html>

Also please note that parser still swallow two chars from each end: as
if "--" still there. Therefore
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

becomes nodeValue and data:

CTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dt

(try coms[0] instead of coms[1] in the code above).

which means that at least in IE it's impossible to set proper DTD and
the browser must be looking for some formal signs (like "w3.org"
substring?) while choosing compatible vs. strict mode.

Thomas! Some *serious* job to you.

Dec 22 '05 #64
VK
> Tested on IE 6.0, FF 1.5, Opera 8.51

By "tested" I mean the same treatment of <! My comment /> as a
comment.

As comments have tagName in IE only, the script will work only for IE.
For FF use DOM Inspector to check.

Dec 22 '05 #65
Michael Winter wrote:
On 20/12/2005 18:59, Thomas 'PointedEars' Lahn wrote:
Michael Winter wrote:
[...] It wasn't defined until HTML 4.0, along with STYLE elements.
Wrong. Both were already declared and defined as an element without
any attribute before HTML 4.0, in HTML 3.2.


Defined? No.


[1] Document Type _Definition_
The phrases 'future use' and 'placeholder' don't appear in
five different locations for the fun of it.
I beg your pardon?
There was no attempt at a definition.


Besides of [1], there is:

,-<URL:http://www.w3.org/TR/REC-html32#script>
|
| These are place holders for the introduction of style sheets and
| client-side scripts in future versions of HTML. User agents should
^^^^^^^^^^^^^^^ ^^^
| hide the contents of these elements.
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^

That is not only a more detailed definition than the DTD already
provides --

| <!ELEMENT STYLE - - CDATA -- placeholder for style info -->
| <!ELEMENT SCRIPT - - CDATA -- placeholder for script statements -->

-- it is also the part of the specification that renders attempts
at "commenting out" `script' element content using empty markup
declarations nonsensical.
Both IE (3.022) and NN (3.0?) had support for the src attribute
before that time.

The point is


I know what the point is.


No, you don't:
that we are trying to use Valid Markup and the argument for
obsolete "comments" is HTML 3.2.


The argument for the behaviour regards (in principle, at least) pre-3.2
user agents and anyone should (and in this thread, does) agree that this
argument has no merit any more. Why you want to argue over irrelevant
specifics is beyond me.


I do not argue over irrelevant specifics.
So there is no point in stating that HTML 3.2 already supported the
element [...]


I would like to remind you that I was not the one that introduced the
matter of, or initiated any reference to, HTML 3.2. If you feel that
there is no point in discussing it, you might want to ask yourself why
you decided to bring it up.


You snipped what brought meaning to this sentence in the context of
my counter-argument against your counter-argument. JFYI, you stated
that

,-[news:Fu******** **********@text .news.blueyonde r.co.uk]
|
| The best solution to the problem always was, and still is, what is
^^^^^^^^^^^^^^^ ^^^^^^^^^
| written in the second paragraph of that section.

with which you referred to:

,-<URL:http://www.w3.org/TR/html4/interact/scripts.html#h-18.3.2>
|
| [...]
| Another solution to the problem is to keep scripts in external
| documents and refer to them with the src attribute.

I commented that there was no `src' attribute for the `script' element
in HTML 3.2, so following your recommendation would create invalid markup
when declaring HTML 3.2 (which is the earliest possible valid version),
which cannot qualify as being the "best solution [...] always was, and
still is" -- a contradiction:

,-[news:24******** ********@Pointe dEars.de]
|
| [i]n HTML 3.2 the `script' element has no attributes at all.

Your counter-argument was that

| In HTML 3.2, the SCRIPT element was nothing more than a placeholder,
| though NN2 was using it. It wasn't defined until HTML 4.0, along with
^^^^^^^^^^^^^^^ ^^^^^^^^
| STYLE elements. Both IE (3.022) and NN (3.0?) had support for the src
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^
| attribute before that time.
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^

And my counter-argument was that this argumentation of yours contains
a contradiction in context of the reasoning for not using "comments":

,-[news:59******** *********@Point edEars.de]
| [...]
| [...] there is no point in stating that HTML 3.2 already supported
^^^^^^^^^^^^^^^ ^^^^
| the element and only now-obsolete or then-tagsoup parsers require the
| "comment", but despite HTML 3.2 did not support the `src' attribute,
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^
| we use it anyway because some tagsoup parsers did.
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^
PointedEars
Dec 22 '05 #66
VK wrote:
Tested on IE 6.0, FF 1.5, Opera 8.51


By "tested" I mean the same treatment of <! My comment /> as a
comment.


That is not Valid markup, of whatever SGML-based markup language. A user
agent that recognizes that as a comment is badly b0rken. What really
happens is that IE probably does not care and FF ignores it because it
cannot make any sense of it; that does not make it any more a comment
than any other invalid markup ignored by the parsers of these UAs.

<URL:http://validator.w3.or g/>

Would you please recognize the syntax for markup declarations in those
languages? Thanks in advance.
PointedEars
Dec 22 '05 #67
VK

Thomas 'PointedEars' Lahn wrote:
That is not Valid markup, of whatever SGML-based markup language. A user
agent that recognizes that as a comment is badly b0rken. What really
happens is that IE probably does not care and FF ignores it because it
cannot make any sense of it; that does not make it any more a comment
than any other invalid markup ignored by the parsers of these UAs.


Did you run the test script in IE? It is not an ignored tag - it is
fully qualified #comment with all appropriate properties (as well as
DTD declaration)

Did you use DOM Inspector in Firefox? Tools > DOM Inspector (if
installed)
It is a fully valid #comment node.

Thomas! *Explain* the reality - do not *negate* it! ;-)

Dec 22 '05 #68
On 22/12/2005 13:40, Thomas 'PointedEars' Lahn wrote:

[snip]
[1] Document Type _Definition_
I would place the emphasis on "Document Type". The DTD does not define
elements themselves - that is what the prose of the specification is
meant to do - but rather which elements (and attributes) are included in
that 'version' of HTML.

[snip]
| These are place holders for the introduction of style sheets and
| client-side scripts in future versions of HTML. User agents should
^^^^^^^^^^^^^^^ ^^^
| hide the contents of these elements.
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^
If you consider that to be a definition, so be it. I do not. To me, the
first sentence reads that the SCRIPT and STYLE elements are simply being
declared, but will not be defined until a future version. As such, "user
agents should hide the contents of these elements" because they should
be considered known and not subject to error correction procedures.

As for their presence in the DTD, it would be necessary to include them
for the benefit of an SGML parser.

[snip]
JFYI, you stated that

,-[news:Fu******** **********@text .news.blueyonde r.co.uk]
|
| The best solution to the problem always was, and still is, what is
^^^^^^^^^^^^^^^ ^^^^^^^^^
| written in the second paragraph of that section.

with which you referred to:

,-<URL:http://www.w3.org/TR/html4/interact/scripts.html#h-18.3.2>
|
| [...]
| Another solution to the problem is to keep scripts in external
| documents and refer to them with the src attribute.

I commented that there was no `src' attribute for the `script' element
in HTML 3.2 [...]
You seem to have completely ignored the fact that I amended my statement
in a follow-up.

[snip]
,-[news:24******** ********@Pointe dEars.de]
|
| [i]n HTML 3.2 the `script' element has no attributes at all.

Your counter-argument was that

| In HTML 3.2, the SCRIPT element was nothing more than a placeholder,
| though NN2 was using it. It wasn't defined until HTML 4.0, along with
^^^^^^^^^^^^^^^ ^^^^^^^^
| STYLE elements. Both IE (3.022) and NN (3.0?) had support for the src
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^
| attribute before that time.
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
It was not a counter-argument, just a statement. In HTML 3.2, the SCRIPT
element did not have a src attribute, but then the intent of HTML 3.2
was to "capture recommended practice", which essentially meant to
document then-current features in existing implementations (such as the
SCRIPT and STYLE elements).

At that time, the use of comments would have been necessary to prevent
then-older (now obsolete) browsers from rendering SCRIPT element
content. However, since the introduction of the src attribute, its
implementation, and the general recognition of the SCRIPT element
(regardless of the ability to execute its contents), the use of comments
is not necessary, and has been so for many years.
And my counter-argument was that this argumentation of yours contains
a contradiction in context of the reasoning for not using "comments":


I was not, at any point, reasoning for using comments.

[snip]

Now hopefully no continuation of this discussion will be necessary.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 22 '05 #69
Michael Winter wrote:
On 22/12/2005 13:40, Thomas 'PointedEars' Lahn wrote:
[1] Document Type _Definition_
I would place the emphasis on "Document Type". The DTD does not define
elements themselves -


So a definition does not define things.
that is what the prose of the specification is meant to do -
Rubbish.
[...]
| These are place holders for the introduction of style sheets and
| client-side scripts in future versions of HTML. User agents should
^^^^^^^^^^^^^^^ ^^^
| hide the contents of these elements.
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^
If you consider that to be a definition, so be it. I do not. [...]


You are free to think so.
JFYI, you stated that

,-[news:Fu******** **********@text .news.blueyonde r.co.uk]
|
| The best solution to the problem always was, and still is, what is
^^^^^^^^^^^^^^^ ^^^^^^^^^
| written in the second paragraph of that section.

with which you referred to:

,-<URL:http://www.w3.org/TR/html4/interact/scripts.html#h-18.3.2>
|
| [...]
| Another solution to the problem is to keep scripts in external
| documents and refer to them with the src attribute.

I commented that there was no `src' attribute for the `script' element
in HTML 3.2 [...]


You seem to have completely ignored the fact that I amended my statement
in a follow-up.


Fair enough.
[snip]
,-[news:24******** ********@Pointe dEars.de]
|
| [i]n HTML 3.2 the `script' element has no attributes at all.

Your counter-argument was that

| In HTML 3.2, the SCRIPT element was nothing more than a placeholder,
| though NN2 was using it. It wasn't defined until HTML 4.0, along with
^^^^^^^^^^^^^^^ ^^^^^^^^
| STYLE elements. Both IE (3.022) and NN (3.0?) had support for the src
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^
| attribute before that time.
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
It was not a counter-argument, just a statement.


Now come on, you used that for your argumentation, despite your "amendment" .
And my counter-argument was that this argumentation of yours contains
a contradiction in context of the reasoning for not using "comments":


I was not, at any point, reasoning for using comments.


And I did not say so.
Now hopefully no continuation of this discussion will be necessary


Hopefully.
PointedEars
Dec 22 '05 #70

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3969
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer http://sourceforge.net/projects/cpp-perfometer http://alexvn.freeservers.com/s1/perfometer.html
4
2463
by: Conrad Weyns | last post by:
vc7.1 has no problem with the following snippet: template <typename T> class TTest { std::list<T*>::iterator m_It; }; but metrowerks codewarrior 9.2 kicks my butt and online Comeau confirms: 1. MW:
1
18514
by: soup_or_power | last post by:
I'm passing the return from window.open as a function argument and getting the error "missing ] after element list" when tested with FireFox. Here is the relevant code. Many thanks for your help. function blurCkbox(num, disp, but_id, sugg) { if (num == 1) { eval("self.opener.document.forms." + but_id + ".value=\'" + sugg + "\'");
77
17069
by: Ville Vainio | last post by:
I tried to clear a list today (which I do rather rarely, considering that just doing l = works most of the time) and was shocked, SHOCKED to notice that there is no clear() method. Dicts have it, sets have it, why do lists have to be second class citizens?
2
17923
by: ehsansad | last post by:
I have the following code. function updateTermsList() { var termDivBox = document.getElementById("termarea"); var terms = searchXMLHttp.responseXML.getElementsByTagName("term"); for(var i=0;i<terms.length;i++){ var name = terms.childNodes.firstChild.nodeValue; var value = new String(terms.childNodes.firstChild.nodeValue); var a = document.createElement('div');
5
2272
by: Vv_vV | last post by:
Hi all, I try to call onchange a function and get "missing ) after argument list" error Probably systaxis issue Thanks in advance for any help! Code: var html = ""; var myurl = "http://www.example.com/url.php?dummy=";
9
4051
by: deedub65 | last post by:
I am getting a "Missing ) after argument list" on two different sets of commands in the same script - they are part of Dreamweaver MX's files, so i am not sure how they got altered - thanks for the help! function canAcceptCommand() { // Make sure the focus is in the BODY of the document. var retVal = false; if (dw.getFocus() == 'document' && dw.getDocumentDOM().getFocus() == 'body') { retVal = true; } if...
4
10692
by: Pasquale | last post by:
I am attempting to populate a few select drop down menus from the selection of the first drop down. I am using ajax to submit data via a PHP GET and from the response populate the other drop down menus. I figured out how to get it to do so for more than one drop down, but I am getting the following error below. This was working fine until I tried to populate more than one other drop down menu. Any idea why the SELECT object isn't being...
8
2302
by: A. Anderson | last post by:
Howdy everyone, I'm experiencing a problem with a program that I'm developing. Take a look at this stack report from GDB - #0 0xb7d782a3 in strlen () from /lib/tls/i686/cmov/libc.so.6 #1 0xb7d4c2f7 in vfprintf () from /lib/tls/i686/cmov/libc.so.6 #2 0xb7d6441b in vsprintf () from /lib/tls/i686/cmov/libc.so.6 #3 0x08049ba0 in character_data::printf (this=0x800, argument=0x0) at character.c:198
1
1598
by: hariomt | last post by:
Hi, i have to create table's rows dynamically. I am using bellow code snipet... function copySelectedAttr() { var attrValue= document.getElementById('fromEntityAttrBox').options.text; var attrtype=document.getElementById('fromEntityAttrBox').value;
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10238
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.