alert() and confirm() function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy Fish

    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


  • Martin Honnen

    #2
    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


    Comment

    • Douglas Crockford

      #3
      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.

      Comment

      • Laurent Bugnion, GalaSoft

        #4
        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

        Comment

        • Martin Honnen

          #5
          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.offsetL eft/offsetWidth/offsetParent
          are not standardized anywhere

          --

          Martin Honnen


          Comment

          • Jim Ley

            #6
            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.javas cript FAQ - http://jibbering.com/faq/

            Comment

            • Lee

              #7
              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.

              Comment

              • Dr John Stockton

                #8
                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@blueyon der.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.demo n.co.uk/> - FAQqish topics, acronyms & links.
                PAS EXE TXT ZIP via <URL:http://www.merlyn.demo n.co.uk/programs/00index.htm>
                My DOS <URL:http://www.merlyn.demo n.co.uk/batfiles.htm> - also batprogs.htm.

                Comment

                Working...