求救!帮忙看一下吧,已经不行了

来源:2-7 编程练习

远去的蝉鸣

2015-06-29 17:29

<!DOCTYPE html>

<html>

 <head>

  <title> new document </title>  

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

  <script type="text/javascript">  

    function openWindows(){

    var open=confirm("open or not");

if(open==true)

{var url=prompt("is this address?","http;//www.imooc.com");

if(url !=null)

{window.open(url,"_blank,",'width=600px,height=400px,menubar=no,toolbar=no');

}

else{alert("see you again");

}

else{alert("see you");}

}

  </script> 

 </head> 

 <body> 

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

 </body>

</html>


写回答 关注

3回答

  • dire
    2015-06-30 23:51:29

    复制那么一大蛋子代码有什么用?把关键地方代码复制过来就行了,看着烦

  • Mr丶Du
    2015-06-29 17:55:09

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

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

    <title>无标题文档</title>

    <script type="text/javascript">  

        function openWindow(){

        var open=confirm("open or not");

    if(open==true){

    var url=prompt("is this address?","http;//www.imooc.com");

    if(url !=null){

    window.open(url,"_blank,",'width=600px,height=400px,menubar=no,toolbar=no');

    }

    else{

    alert("see you again");

    }

    }

    else{

    alert("see you");

    }

    }

      </script> 

    </head>


    <body>

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

    </body>

    </html>


  • 程序员之路
    2015-06-29 17:49:48
    <!DOCTYPE html>
    <html>
    
    	<head>
    		<title> new document </title>
    		<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
    		<script type="text/javascript">
    			function openWindows(){
    			    var open=confirm("open or not");
    				if(open==true){
    					var url=prompt("is this address?","http;//www.imooc.com");
    					if(url !=null){
    						window.open(url,"_blank,",'width=600px,height=400px,menubar=no,toolbar=no');
    					}else{
    						alert("see you");
    						alert("see you again");
    					}
    				}
    			}
    		</script>
    	</head>
    
    	<body>
    		<input type="button" value="新窗口打开网站" onclick="openWindows()" />
    	</body>
    
    </html>

    哥们,工欲善其事,必先利其器!刚学吗?HBuilder,给你推荐个开发平台。

JavaScript入门篇

JavaScript做为一名Web工程师的必备技术,本教程让您快速入门

741116 学习 · 9865 问题

查看课程

相似问题