问答详情
源自:8-1 window对象

运行完后有undefined并且没有打开新窗口??

<!DOCTYPE HTML>

<html>

<head>

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

<title>window对象</title>

<script type="text/javascript">

function openNew()

{

    document.write(alert("欢迎来到慕课网!!"));

    window.open('https://www.imooc.com/','_blank','width=600','height=400');

}

</script>

</head>

<body>

<form>

<input type="button" value="点击我,打开新窗口" onclick="openNew()" />

</form>

</body>

</html>


提问者:1热忱 2018-07-16 16:29

个回答