window 物件方法,可省略 window. 前綴。window.alert("歡迎!請按「確定」繼續。");
var ok = window.confirm("點擊「確定」繼續,點擊「取消」停止。");
if (ok) {
window.alert("歡迎光臨!");
} else {
window.alert("再見!");
}
true/false。var name = window.prompt("請輸入姓名:", "預設值");
if (name !== null) {
window.alert("你好," + name + "!");
}
null。