練習(xí)代碼代碼
?function openWindow(){
? ? ? ? var openw=confirm("是否打開");
? ? ? ? var two;
? ? ? ? if(openw==true)
? ? ? ? {
? ? ? ? two=prompt("請輸入網(wǎng)址","http://idcbgp.cn/");
? ? ? ? ? ? if(two!=null)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? window.open(two,'_blank','width=400,height=500')
? ? ? ? ? ? }
? ? ? ? }
? ? ? ??
? ? ? ? }
2019-05-08
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">??
? ? function openWindow(){
? ? ? ? var msg=confirm("打開窗口?");
? ? ? ? if(msg==true){
? ? ? ? ? ? var b=prompt("輸入網(wǎng)址");
? ? ? ? ? ? if(b=" http://idcbgp.cn/"){
? ? ? ? ? ? ? ? window.open('b','widtn=400','heigth=500');
? ? ? ? ? ? }
? ? ? ? ? ? else{ window.close();}
? ? ? ? }
? ? ? ? else{window.close();}
? ? }
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站"