alert 小问题!

skyzyg 2005-12-19 09:54:48
我想问一下alert() 有几个参数,都是什么,举个例子
...全文
181 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
yzyun 2005-12-21
  • 打赏
  • 举报
回复
alert Method
--------------------------------------------------------------------------------

Displays a dialog box containing an application-defined message.

Syntax

window.alert( [sMessage])
Parameters

sMessage Optional. String that specifies the message to display in the dialog box.

Return Value

No return value.

Remarks

You cannot change the title bar of the Alert dialog box.

Standards Information

There is no public standard that applies to this method.

Applies To
MrYou 2005-12-21
  • 打赏
  • 举报
回复
alert对话框的标题什么的不是改参数就能改的,相当复杂了
KimSoft 2005-12-21
  • 打赏
  • 举报
回复
只有一个
window.alert("message");


alert
Displays an Alert dialog box with a message and an OK button.
方法源 Window
实现版本 Navigator 2.0



语法
alert("message")
参数
message A string.



描述
An alert dialog box looks as follows:


Use the alert method to display a message that does not require a user decision. The message argument specifies a message that the dialog box contains.

You cannot specify a title for an alert dialog box, but you can use the open method to create your own alert dialog box. See open.


示例
In the following example, the testValue function checks the name entered by a user in the Text object of a form to make sure that it is no more than eight characters in length. This example uses the alert method to prompt the user to enter a valid value.
function testValue(textElement) {
if (textElement.length > 8) {
alert("Please enter a name that is 8 characters or less")
}
} You can call the testValue function in the onBlur event handler of a form's Text object, as shown in the following example:

Name: <INPUT TYPE="text" NAME="userName"
onBlur="testValue(userName.value)">

参看
Window.confirm, Window.prompt
afoskoo 2005-12-21
  • 打赏
  • 举报
回复
js真的只有一个,vbscript的msgbox才有几个.
matrixy 2005-12-19
  • 打赏
  • 举报
回复
只有那一个参数吧...

一个字符串....
haitun1983 2005-12-19
  • 打赏
  • 举报
回复
在JS中只有一个参数,如
alert("只有一个参数");
就这样
ybfqlyq 2005-12-19
  • 打赏
  • 举报
回复
JS中,只有一个参数。
Aallonlin 2005-12-19
  • 打赏
  • 举报
回复
JS中,只有一个参数。
skyzyg 2005-12-19
  • 打赏
  • 举报
回复
不只是一个,对话框的标题应该也可以改!还有那个图表应该也可以改,我记得至少应该有4个参数!

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧