浏览器通过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()
var reuslt = prompt( "what's your name" , "" );
if (reuslt != null ) {
alert( "welcome" +reuslt);
}
//显示“打印”对话框
window.print();
//显示“查找”对话框
window.find();