473,382 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 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 18427


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Slartybartfast | last post by:
I have a link that when clicked does something on another machine, and it all works fine. <a href=http://www.remotedomain.com/cgi-bin/task.cgi?identifier>Do That Thing</a> But I thought it...
9
by: Justin Koivisto | last post by:
Is there a way to create an alert-like message box that uses a custom image? Basically, I want to replace the default ! image with something else. -- Justin Koivisto - spam@koivi.com PHP...
7
by: Tasha's Dad | last post by:
A description of the problem: 1) Go to a page with various settings and a timeout (forces re-login if over 10 minutes) 2) Before the timeout, make some changes to settings. 3) Press a "reset to...
2
by: Hans | last post by:
Hi! I have an asp application where I use a lot of javascript for validations etc and as it is today I use alert, confirm and prompt dialogs. Now we are adding support for unicode and I have...
2
by: Little Pete | last post by:
I use a simple .js script to shuffle files on my computer to which I'd like to add alert and confirmation boxes. Unfortunately I haven't been able to figure out what object I need to create that...
4
by: sonu | last post by:
How can we use alert and confirm method in asp.net application. i am working with application where i want to use confirm box before going for any operation. and same for alert box Sonu
3
by: musclehead | last post by:
Hi everyone, I have, what I hope, will be a simple question. I have a basic JS function to pop-up a confirm delete dialog box when deleting a record from a DB: function confirmDelete() { var...
8
by: Guy Cohen | last post by:
Hi all How do I present questions/messages to the user while I am in a CLICK event of a button ? I was told to look for javascript/vbscript but could not make it work. Please advise Guy
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.