472,145 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

alert() and confirm() function

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
Jul 20 '05 #1
7 18335


Andy Fish wrote:
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.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
> 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.

Jul 20 '05 #3
Hi,

Andy Fish wrote:
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
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 20 '05 #4


Andy Fish wrote:
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

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #5
On Thu, 14 Aug 2003 17:18:10 +0200, Martin Honnen
<Ma***********@t-online.de> wrote:


Andy Fish wrote:
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


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.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #6
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.

Jul 20 '05 #7
JRS: In article <ie********************@news-text.cableinet.net>,
seen in news:comp.lang.javascript, Andy Fish
<aj****@blueyonder.co.uk> posted at Thu, 14 Aug 2003 09:02:06 :-

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/m...ore/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/...00/javascript/
1.3/reference/window.htm>.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Slartybartfast | last post: by
9 posts views Thread by Justin Koivisto | last post: by
7 posts views Thread by Tasha's Dad | last post: by
2 posts views Thread by Little Pete | last post: by
4 posts views Thread by sonu | last post: by
8 posts views Thread by Guy Cohen | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

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.