为了账号安全,请及时绑定邮箱和手机立即绑定

确定->输入地址->转入地址;否则->提示错误->自动关闭窗口

function openWindow(){   if(confirm("是否打开新窗口?")){   var myint=prompt("输入你想访问的网页");   if(myint){   window.open(myint,'_blank'); } else{ alert("输入有误,本窗口自动关闭");                window.close(); } } else{ alert("你不想访问其他网站?"); window.close(); }}

正在回答

4 回答

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>window.open</title>

<script type="text/javascript">

function Wopen(){   

if(confirm("是否打开新窗口?")){   

var myint=prompt("输入你想访问的网页");   

if(true){   

window.open(myint,'_blank'); 

else{ 

alert("你不想访问其他网站?"); 

window.close(); }

}

</script>

</head>

<body>

    <input name="button" type="button" onClick="Wopen()" value="ok" / >

    <input name="button" type="button" onClick="wclose()" value="cancel" / >

</body>

</html>

1 回复 有任何疑惑可以回复我~

<!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 myhref = confirm("你确定要打开网址么?");


   if (myhref == true) {

    var score = prompt("请输入要打开的网址:");

    if (score != null) {

    window.open ('http://' + score,'_blank','width=400px,height=500px,menubar=no,toolbar=no');

    }

    else {

    alert("取消成功");

    }

   

   }

   else {

    alert("成功返回")

   }

    }

    

  </script> 

 </head> 

 <body> 

 <input type="button" value="新窗口打开网站" onclick="openWindow()" /> 

 </body>

</html>


0 回复 有任何疑惑可以回复我~

<!DOCTYPE html>
<html>
 <head>
  <title> new document </title>  
  <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>   
  <script type="text/javascript">  
  window.onload=function openWindow(){
    var str=prompt("请输入网址","http://");
     if(str!=null){
    window.open(str,'_blank');
                   }
    else{
    alert("输入错误");
    window.close();
    
        }
  }
  </script>
 </head>
 <body>
</body>
</html>

0 回复 有任何疑惑可以回复我~

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>window.open</title>

<script type="text/javascript">

  function Wopen(){

  var ad=prompt("输入地址<要加协议,比如:http://>");

      window.open(ad,'jarrem','_blank');

 } 

 function wclose(){

  window.close();

 }

</script>

</head>

<body>

    <input name="button" type="button" onClick="Wopen()" value="ok" / >

    <input name="button" type="button" onClick="wclose()" value="cancel" / >

</body>

</html>


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

确定->输入地址->转入地址;否则->提示错误->自动关闭窗口

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信