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

这一段代码为什么不能运行,谢谢大神帮助!

这一段代码为什么不能运行,谢谢大神帮助!

Mark_孟8 2016-07-10 22:39:02
<!DOCTYPE html><html> <head>  <title> new document </title>    <meta http-equiv="Content-Type" content="text/html; charset=utf8"/>     <script type="text/javascript">          function openWindow(){    var poker=confirm("you sure wanna open the website?");    if(poker=true)    {dream();}    else    {document.write("good boy,you better sheep away!");}        function dream(){    var heart=prompt("put in the website!");    if(heart!=null)    {window.open("heart", "_black", "width=400, height=500, menubar=no, toolbar=no");}    else    {window.open("http://www.imooc.com/", "_black", "width=400, height=500, menubar=no, toolbar=no");}    }          </script>  </head>  <body>    <input type="button" value="新窗口打开网站" onclick="openWindow()" />  </body></html>
查看完整描述

2 回答

?
Caballarii

TA贡献1123条经验 获得超629个赞

  1. openWindow缺少右半边大括号

  2. if(heart!="")

  3. http://www.imooc.com/里的冒号写成了中文的冒号

查看完整回答
反对 回复 2016-07-10
  • 2 回答
  • 0 关注
  • 1348 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信