運(yùn)行結(jié)果都顯示失敗
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>? ?
? <script type="text/javascript">??
? ? function openwindow(){
? ? ? ? var choose=confirm("是否打開?");
? ? ? ? ?if(choose==true){
? ? ? ? ? ? ?var aaa=prompt("確認(rèn)打開網(wǎng)址","http://idcbgp.cn");
? ? ? ? ? ? ?if(aaa==true){
? ? ? ? ? ? ? ? ?window.open(aaa,'_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? ?}
? ? ? ? ? ? ?else{
? ? ? ? ? ? ? ? ?alert("失敗");
? ? ? ? ? ? ?}
? ? ? ? ?}
? ? ? ? ?else{
? ? ? ? ? ? ? ? ?alert("失敗");
? ? ? ? ? ? ?}
? ? }
? ? }
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="openwindow()" />?
?</body>
</html>
2021-12-23
寫法邏輯完全錯(cuò)誤,還多了一個(gè)括號(hào)。。。。。。。。。。。
<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" /> ?
? ? <script type="text/javascript"> ?
? ? ? ? function openWindow(){
? ? ? ? ? ? var choose=confirm("是否打開?");
? ? ? ? ? ? ?if(choose==true){
? ? ? ? ? ? ? ? ?var aaa=prompt("確認(rèn)打開網(wǎng)址","http://idcbgp.cn");
? ? ? ? ? ? ? ? ?window.open(aaa,'_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ?else{
? ? ? ? ? ? ? ? ? ? ?alert("失敗");
? ? ? ? ? ? ? ? ?} ?
? ? ? ? }
? ? ? </script>
直接運(yùn)行走一波