alert() and confirm() function

A

Andy Fish

Hi,

now I know what the alert() function does, but can anyone tell me where I
can find the specification or standards for functions like alert() and
confirm().

They don't seem to be part of the ECMAScript language but aren't part of the
DOM either. Now we seem to be finally reaching a stage of
standards-compliant browsers, there seems to be a bit of a gap here.

Andy
 
M

Martin Honnen

Andy said:
Hi,

now I know what the alert() function does, but can anyone tell me where I
can find the specification or standards for functions like alert() and
confirm().

They don't seem to be part of the ECMAScript language but aren't part of the
DOM either. Now we seem to be finally reaching a stage of
standards-compliant browsers, there seems to be a bit of a gap here.

alert, confirm, prompt are part of the browser object model for client
side JavaScript that hasn't been standardized and will not be
standardized by the W3C as the DOM standard is meant to be independent
of the environment. And the ECMAScript standard is also meant to be
independent of the host environment thus things like alert will never be
part of the ECMAScript standard.
 
D

Douglas Crockford

so you're saying it's just a convention that browsers provide these
functions?

that doesn't sound like a good thing in the drive for standards-based
platform-independent development :-(

Exactly right. And yet, that is how things are.
 
L

Laurent Bugnion, GalaSoft

Hi,

Andy said:
so you're saying it's just a convention that browsers provide these
functions?

that doesn't sound like a good thing in the drive for standards-based
platform-independent development :-(

This can be understood when you know that these methods were actually
planned for development process, to allow easier debugging of JavaScript
applications. The lack of customization of the alert, confirm and prompt
boxes show this clearly as well (you cannot change the texts of the
buttons, for example, or the title).

If you need more specific boxes, you can always do your own in
HTML/JavaScript (small popup) as shown in:
<URL: http://www.galasoft-lb.ch/myjavascript/consulting/2000090401.html>

However, this is a popup, and some users with some browsers can disable
them.

HTH,

Laurent
 
D

Dr John Stockton

JRS: In article <[email protected]>,
seen in Andy Fish
now I know what the alert() function does, but can anyone tell me where I
can find the specification or standards for functions like alert() and
confirm().

According to my saved copy of a Netscape reference page set, they
are Methods of window, and are explained in the window page.

**TRY** a Google search for Last Updated: 05/28/99 12:00:46

That Web page was probably, at the time, linked from and near to
<URL:http://developer.netscape.com/docs/manuals/js/core/jsguide15/
contents.html>.

Lest the page is updated but not much changed, try a search for
"Displays a Confirm dialog box with the specified message and OK
and Cancel buttons" and/or "You cannot specify a title for an
alert dialog box".

Once you find that page, you have found in effect the whole
cornucopia.


You could also search for "Core JavaScript Guide 1.5" in a subdir
jsg15 of a Netscape site - though that may not contain what you
want.


Reading the c.l.j FAQ suggests trying around
<URL: http://devedge.netscape.com/library/manuals/2000/javascript/
1.3/reference/window.htm>.
 
L

Lee

Andy Fish said:
so you're saying it's just a convention that browsers provide these
functions?

that doesn't sound like a good thing in the drive for standards-based
platform-independent development :-(

It's not as unreasonable as you think.

If there was a standard for how automobiles should work,
the features found at roadside rest stops would not be
a part of that standard.

Similarly, the ECMAScript standard describes the language,
only, not the features that the language may find in the
various browsers.
 
M

Martin Honnen

Andy said:
so you're saying it's just a convention that browsers provide these
functions?

that doesn't sound like a good thing in the drive for standards-based
platform-independent development :-(

Well, face it, many things like
window.location
or
element.offsetLeft/offsetWidth/offsetParent
are not standardized anywhere
 
J

Jim Ley

Well, face it, many things like
window.location

window.document isn't even standardised anywhere, the idea that
there's some global var pointing at the document which 99% of all
scripts require doesn't exist in any formal spec. It's just de-facto.

The SVG Working Group are standardising a window interface for SVG 1.2
though. (and it's similar to the HTML one, and browsers like SVG
enabled mozillas will have to support it!)

Jim.
 

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

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top