瀏覽器通過alert(),confirm(),prompt()可以調用系統對話框向用戶顯示信息。
confirm
if(confirm("are you sure?")) {
alert("I'm so glad you're sure");
}
else{
alert("I'm sorry to hear you're not sure");
}
prompt()
varreuslt = prompt("what's your name","");
if(reuslt !=null) {
alert("welcome"+reuslt);
}
//顯示“打印”對話框
window.print();
//顯示“查找”對話框
window.find();