alert窗口為什么 不顯示
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>window.open</title>
<script type="text/javascript">
? function dakai(){
? ? var dakai=confirm("你確定要打開?")
? ? if (dakai==true);
? ? {
? ? window.open('http://www.baidu.com','_blank','width=1366,height=768,menubar=yes,toolbar=yes, status=yes,scrollbars=yes');
? ? }
? ? else
? ? {
? ? ? ? alert("打開失敗!");
? ? }
? } ? ? ?
??
</script>
</head>
<body>
? ? <input name="button" type="button" onClick="dakai()" value="點擊我,打開新窗口!" / >
</body>
</html>
2015-06-18
把這行代碼最后的;去掉即可。
2015-07-01
if..else..不是一起使用的嗎?
2015-07-01
上面的代碼,為什么要去掉if?(dakai==true);才能正常顯示?