confirm的用法。
来源:互联网 发布:imsi号对应省份数据库 编辑:程序博客网 时间:2024/05/22 03:33
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <style type="text/css"> a { border-style:solid; border-color:#cccccc; border-width:1px; padding:2px; margin:0px; color:Black; font-size:smaller; background-color:#eeeeee; text-decoration:none; font-family:@新宋体; } </style> <script type="text/javascript"> function con() { if (confirm("你确定要联系我们吗?")) { //window.location.href = 'http://www.baidu.com'; //location.href = "http://www.baidu.com"; //window.open('http://www.baidu.com'); if (confirm("能不能不联系我们啊?") == true) { return; } else { window.open("http://www.baidu.com"); } } else { return; } } </script></head><body><a href="#" onclick="con()">联系我们</a></body></html>