JS Popup Boxes
来源:互联网 发布:推塔网络游戏要网络吗 编辑:程序博客网 时间:2024/06/05 13:31
In JavaScript we can create three kinds of popup boxes: Alert box, Confirm box, and Prompt box.
在JS里我们可以建立三种不同样子的popup boxes弹出框:警示框,确认框,信息框
Examples
例子
Alert box[警示框]
Alert box with line breaks[换行的警告框]
Confirm box[换行的警告框]
Prompt box[信息框(可输入参数)]
Alert Box
警示框
An alert box is often used if you want to make sure information comes through to the user.
如果你想保证让用户得到信息就使用警示框
When an alert box pops up, the user will have to click "OK" to proceed.
当警示框弹出,用户必须按“OK”来继续
Syntax:
语法:
alert("sometext")
Confirm Box
确认框
A confirm box is often used if you want the user to verify or accept something.
确认框用来让用户核实或是接受一些信息。
When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed.
当信息框弹出,用户必须按“OK”或者“Cancel”来继续
If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.
如果用户按"OK"就返回真,按"取消"就返回假
Syntax:
语法:
confirm("sometext")
Prompt Box
信息框
A prompt box is often used if you want the user to input a value before entering a page.
信息框用来让用户在进入页面前输入值。
When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value.
当信息框弹出,用户将在输入值后按“OK”或“Canel”来继续(下面的操作)
If the user clicks "OK" the box returns the input value. If the user clicks "Cancel" the box returns null.
按“OK”就会返回输入的值,按“取消”就会返回空值
Syntax:
语法:
prompt("sometext","defaultvalue")
- JS Popup Boxes
- JavaScript Popup Boxes
- popup.js
- JS中popup.js
- javaScript Popup.js
- Popup.js 弹出窗口
- javaScript Popup.js
- js动态创建popup
- Popup.js 弹出窗口
- 原生JS编写popup
- popup.js封装
- Popup.js 弹出窗口
- Popup.js 弹出窗口简介
- popup.js弹出层回调关闭
- POPUP
- Popup
- popup
- popup
- JS 操作符
- FTP的2种工作模式(port and passive)
- winform下拉框篇.类似Word的颜色下拉框
- UI行业常用名词及缩写定义
- mysql xml http://libmyxql.sourceforge.net/
- JS Popup Boxes
- 给图片加上带版权的水印
- 对于update命令只有vfp9支持
- JS 函数
- JS For 循环
- 程序员的七种武器
- 判断一个数据表是否为空
- 你不知道的网络招聘与求职潜规则
- 判断一个库的记录是不是都已经打上删除标记了