第一步confirm就打不開啊這是為啥???
<!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 mymessage=confirm("確認(rèn)打開新網(wǎng)站嗎?")
? ? ? ? if(mymessage==true){
? ? ? ? ? ? var window;
? ? ? ? ? ? window=prompt("請輸入你要打開的網(wǎng)站:", "http://idcbgp.cn/");
? ? ? ? ? ? if(window!=null){
? ? ? ? ? ? window.open('http://idcbgp.cn/','_blank''width:400,height:500,menubar=no,toolbar=no');
? ? ? ? }
? ? }
? ? ? ? else{
? ? ? ? ? ? alert("不打開網(wǎng)站了");
? ? ? ? }
? ? }
??
? ??
? ??
? </script>?
?</head>?
?<body>?
? ? ? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2019-03-19
這代碼出來的是函數(shù)。。
函數(shù)不調(diào)用是沒有效果的
2019-03-18
<!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 mymessage=confirm("確認(rèn)打開新網(wǎng)站嗎?");
? ? ? ? if(mymessage==true){
? ? ? ? ? ? var mywindow = prompt("請輸入你要打開的網(wǎng)站:", "http://idcbgp.cn/");
? ? ? ? ? ? if(mywindow!=null){
? ? ? ? ? ? ? ? window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no')
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? else{
? ? ? ? ? ? alert("不打開網(wǎng)站了");
? ? ? ? }
? ? }
? </script>?
?</head>?
?<body>?
? ? ? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2019-03-17
'_blank'后面少個(gè)逗號
2019-03-15
confirm("確認(rèn)打開新網(wǎng)站嗎?");少了“;”