Connecting Tech Pros Worldwide Help | Site Map

alert() and confirm() function

  #1  
Old July 20th, 2005, 10:39 AM
Andy Fish
Guest
 
Posts: n/a
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


  #2  
Old July 20th, 2005, 10:39 AM
Martin Honnen
Guest
 
Posts: n/a

re: alert() and confirm() function




Andy Fish wrote:[color=blue]
> 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.[/color]

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/

  #3  
Old July 20th, 2005, 10:39 AM
Douglas Crockford
Guest
 
Posts: n/a

re: alert() and confirm() function


> so you're saying it's just a convention that browsers provide these[color=blue]
> functions?
>
> that doesn't sound like a good thing in the drive for standards-based
> platform-independent development :-([/color]

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

  #4  
Old July 20th, 2005, 10:40 AM
Laurent Bugnion, GalaSoft
Guest
 
Posts: n/a

re: alert() and confirm() function


Hi,

Andy Fish wrote:[color=blue]
> 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 :-([/color]

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

  #5  
Old July 20th, 2005, 10:40 AM
Martin Honnen
Guest
 
Posts: n/a

re: alert() and confirm() function




Andy Fish wrote:[color=blue]
> 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 :-(
>[/color]

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

--

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

  #6  
Old July 20th, 2005, 10:40 AM
Jim Ley
Guest
 
Posts: n/a

re: alert() and confirm() function


On Thu, 14 Aug 2003 17:18:10 +0200, Martin Honnen
<Martin.Honnen@t-online.de> wrote:
[color=blue]
>
>
>Andy Fish wrote:[color=green]
>> 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 :-(
>>[/color]
>
>Well, face it, many things like
> window.location[/color]

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/

  #7  
Old July 20th, 2005, 10:40 AM
Lee
Guest
 
Posts: n/a

re: alert() and confirm() function


Andy Fish said:[color=blue]
>
>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 :-([/color]

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.

  #8  
Old July 20th, 2005, 10:40 AM
Dr John Stockton
Guest
 
Posts: n/a

re: alert() and confirm() function


JRS: In article <ieI_a.1056$402.8266843@news-text.cableinet.net>,
seen in news:comp.lang.javascript, Andy Fish
<ajfish@blueyonder.co.uk> posted at Thu, 14 Aug 2003 09:02:06 :-[color=blue]
>
>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().[/color]

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.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Confirm function pradeep answers 1 April 23rd, 2007 05:35 PM
confirm() function doesn't seem to work Eric answers 8 October 1st, 2006 10:45 AM
Simulating Alert / Confirm Tony answers 3 January 26th, 2006 07:55 PM