Javascript [Electronic resources] : The Definitive Guide (4th Edition) نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Javascript [Electronic resources] : The Definitive Guide (4th Edition) - نسخه متنی

David Flanagan

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



Availability


JavaScript 1.0


Synopsis

window.alert(message)

Arguments



message

The
plain-text (not HTML) string to display in a dialog box popped up
over window.


Description


The alert( ) method displays the specified
message to the user in a dialog box. The
dialog box contains an

OK button
that the user can click to dismiss the dialog box.

On Windows platforms, the dialog box displayed by alert(
) is modal, and JavaScript execution pauses until the user
dismisses it. In Netscape 4 on Unix platforms, however, the
alert( ) dialog box is nonmodal, and execution
continues uninterrupted.


Usage


Perhaps the most common use of the alert( ) method
is to display error messages when the user's
input to some form element is invalid in some way. The alert dialog
box can inform the user of the problem and explain what needs to be
corrected to avoid the problem in the future.

The appearance of the alert( ) dialog box is
platform-dependent, but it generally contains graphics that indicate
an error, warning, or alert message of some kind. While
alert( ) can display any desired message, the
alert graphics of the dialog box mean that this method is not
appropriate for simple informational messages like "Welcome to
my home page" or "You are the 177th visitor this
week!"

Note that the message displayed in the
dialog box is a string of plain text, not formatted HTML. You can use
the newline character "\n" in your strings to break your
message across multiple lines. You can also do some rudimentary
formatting using spaces and can approximate horizontal rules with
underscore characters, but the results depend greatly on the font
used in the dialog box, and thus are system-dependent.


See Also


Window.confirm( ), Window.prompt( )

/ 844