老师,我这种编法哪里出错了?

来源:2-7 编程练习

weibo_这都很重要_0

2015-02-25 00:02

<!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 one=confirm("确定吗?");

    if(one==true){

window.open('http://www.imooc.com/','_blank','width=400px,height=500px,menubar=no,toolbar=no,scrollbars=yes,status=yes');

}

else

document.write("nothing");

}

  </script> 

 </head> 

 <body> 

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

 </body>

</html>


写回答 关注

2回答

  • qq_小小俊同学_0
    2015-02-26 01:27:56

    其实我习惯性把输入法 "Shift"设置成 "Ctrl" 切换中英输入


  • 无兄弟不编程
    2015-02-25 00:29:46

    刚帮你看了 是这句话 var one=confirm("确定吗?");后面的分号写错了

JavaScript入门篇

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

742051 学习 · 9869 问题

查看课程

相似问题