473,811 Members | 2,869 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 16943
Matt Kruse wrote:
Thomas 'PointedEars' Lahn wrote:
I have to take that back and to state the opposite. That SyntaxError
was apparently caused by other code, so it appears that JavaScript-C
1.5 2004-09-24 (SpiderMonkey) [1] considers `<!--' the same as `//',
apparently as an undocumented extension to ECMAScript.
This is standard behavior for every JScript/Javascript/ECMAScript
implementation I have ever seen.


Which does not count.
Just because it is not documented in ECMAScript specs doesn't mean it
is not documented.
Which does not count either. You really should have read the provision
attached to the posting you replied to.
Keep in mind, a browser implementing <script type="text/javascript">
doesn't need to support ECMAScript either.


Which does not count. The environment that scripts are operating in is
unknown most of the time, it is wrong and potentially harmful to infer
from the special case to the general one as you do.
PointedEars
Dec 19 '05 #41
Thomas 'PointedEars' Lahn wrote:
The environment that scripts are operating in
is unknown most of the time, it is wrong and potentially harmful to
infer from the special case to the general one as you do.


Listen, either way it's a guessing game. And I'm talking _only_ about the
statement that it's potentially harmful, not that it's a recommended
practice. There are two bets you can take:

1. A browser will be made in the near future with a javascript engine that
does not treat <!-- as a single-line comment.

2. Browsers will continue to treat <!-- as a single-line comment in
javascript, even though it's not part of standards

You're betting on #1. However, browsing the web with such a browser would be
a terrible experience because of all the syntax errors you would encounter.
I find it highly unlikely that such a browser would ever be made, much less
used. Maybe in 20 years ;)

I'm betting on #2, because a survey of the current browser world shows that
every browser behaves as expected and continues to do so in every update.
Even if not documented, the behavior remains.

Conclusion: If you bet on #1, you would consider it to be potentially
harmful. If you bet on #2, it's not potentially harmful.

I think #2 is the much more realistic bet. And one I would be willing to
take with you for any amount of cash ;)

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Dec 19 '05 #42
Lasse Reichstein Nielsen wrote:
Actually, the official name for the language used by the Netscape
browsers and inheriteed by the Mozilla based browsers, including the
Spidermonkey engine, is "JavaScript ". This is also the name that is
trademarked by Sun Microsystems, Inc.


By /Sun/?

--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"
Dec 19 '05 #43
John W. Kennedy wrote:
Lasse Reichstein Nielsen wrote:
Actually, the official name for the language used by the Netscape
browsers and inheriteed by the Mozilla based browsers, including the
Spidermonkey engine, is "JavaScript ". This is also the name that is
trademarked by Sun Microsystems, Inc.


By /Sun/?


Yes, indeed by Sun. The programming language developed by Brendan Eich,
previously of Netscape Communications Corp., now working for the Mozilla
Foundation, formerly known as Mocha or LiveScript, was renamed to
"JavaScript " in a joint marketing effort of Netscape Communications Corp.
and Sun Microsystems, Inc.

<URL:http://www.sun.com/suntrademarks/#J>
<URL:http://wp.netscape.com/newsref/pr/newsrelease67.h tml>
<URL:http://en.wikipedia.or g/wiki/JavaScript>
PointedEars
Dec 20 '05 #44
Thomas 'PointedEars' Lahn wrote:
They have Javascript/JScript/etc. In these implementations
of ECMAScript, I've not seen one yet that didn't treat
<!--
as a single-line comment. In fact, they document it as so.

Where?


Try this:
http://www.w3.org/TR/html401/interac....html#h-18.3.2

The most recent HTML 4.01 specs say this:

"User agents that don't recognize the SCRIPT element will likely render that
element's contents as text. Some scripting engines, including those for
languages JavaScript, VBScript, and Tcl allow the script statements to be
enclosed in an SGML comment. User agents that don't recognize the SCRIPT
element will thus ignore the comment while smart scripting engines will
understand that the script in comments should be executed."

Good enough for you?

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Dec 20 '05 #45
On 20/12/2005 06:24, Matt Kruse wrote:
Thomas 'PointedEars' Lahn wrote:
Matt Kruse wrote:
They have Javascript/JScript/etc. In these implementations
of ECMAScript, I've not seen one yet that didn't treat
<!--
as a single-line comment. In fact, they document it as so.
Where?


Try this:
http://www.w3.org/TR/html401/interac....html#h-18.3.2


[snip]
Good enough for you?


Not particularly. It's an informative statement on the state of things
as the W3C saw them at the time of publishing. It in no way implies that
that's the way things /should/ be, and all that it confirms is what we
already know: most user agents will ignore the comments if they surround
code. However, what it doesn't say is what you wrote above.

The best solution to the problem always was, and still is, what is
written in the second paragraph of that section.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 20 '05 #46
Matt Kruse wrote:
Thomas 'PointedEars' Lahn wrote:
They have Javascript/JScript/etc. In these implementations
of ECMAScript, I've not seen one yet that didn't treat
<!--
as a single-line comment. In fact, they document it as so.

Where?


Try this:
http://www.w3.org/TR/html401/interac....html#h-18.3.2
[...]


FYI: You were stating that `<!--' is _documented_ as being a single-line
comment in a documentation for _"JavaScript/JScript/etc."_. It is not
the W3C that sets the standard for the former, and as I already pointed
out that section of the HTML 4.01 Specification, which is not normative
regarding ECMAScript implementations at all, was written and issued
before RFC2854 was issued, which obsoleted all HTML versions this section
was intended to create backwards compatibility to.
PointedEars
Dec 20 '05 #47
Michael Winter wrote:
On 20/12/2005 06:24, Matt Kruse wrote:
Thomas 'PointedEars' Lahn wrote:
Matt Kruse wrote:
They have Javascript/JScript/etc. In these implementations
of ECMAScript, I've not seen one yet that didn't treat
<!--
as a single-line comment. In fact, they document it as so.
Where?

Try this:
http://www.w3.org/TR/html401/interac....html#h-18.3.2


[snip]
Good enough for you?


Not particularly. [...]
The best solution to the problem always was, and still is, what is
written in the second paragraph of that section.


Where it is to be noted that in HTML 3.2 the `script' element has no
attributes at all.

<URL:http://www.w3.org/TR/REC-html32#script>
PointedEars
Dec 20 '05 #48
On 20/12/2005 18:01, Thomas 'PointedEars' Lahn wrote:
Michael Winter wrote:
[snip]
The best solution to the problem always was, and still is, what is
written in the second paragraph of that section.


'Always' is a little misleading. However, the time frame should be at
least seven years, which is certainly long enough.

[snip]
[i]n HTML 3.2 the `script' element has no attributes at all.


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.

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 20 '05 #49
Michael Winter wrote:
On 20/12/2005 18:01, Thomas 'PointedEars' Lahn wrote:
> Michael Winter wrote:
[i]n HTML 3.2 the `script' element has no attributes at all.
In HTML 3.2, the SCRIPT element was nothing more than a placeholder,


It is declared as an element in the HTML 3.2 Document Type Definition.
[...] 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.
Both IE (3.022) and NN (3.0?) had support for the src attribute before
that time.


The point is that we are trying to use Valid Markup and the argument for
obsolete "comments" is HTML 3.2. So 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 20 '05 #50

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

Similar topics

8
3972
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
2466
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
18515
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
17073
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
17924
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
4052
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
10693
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
2305
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
1599
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
9603
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,...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10393
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
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.