为什么这段代码在慕课教程里就可以执行. 但给它复制到出来保存并运行就提示"未定义"呢?

https://img2.mukewang.com/5b7bb8e900017bcb02880742.jpg

https://img3.mukewang.com/5b7bb8ea00014bb806780369.jpg


天天向上学
浏览 743回答 1
1回答

诺丁山丶

<!doctype html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport"  content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">     <meta http-equiv="X-UA-Compatible" content="ie=edge">     <title>Document</title>     <script type="text/javascript">         function Wopen() {             window.open("http://www.imooc.com","_blank","width=600,height=400,top=100,left=0");  }     </script> </head> <body> <input type="text" name="button" type="button" onClick="Wopen()" value="点击我打开新窗口"> </body> </html>我把你的代码重写了一遍,没有问题,可以正常弹出,无报错。代码贴出来了,你复制后试试看。你截图的代码片段,没发现问题。-------------------------------------TIPS:以后问问题,源代码不要截图!源代码不要截图!源代码不要截图!方便查抄错误。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript