以下 scipt 返回文档(HTML 文档)和窗口的宽度和高度。但它的返回错误。
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
var txt="";
txt+="Document width/height: " + $(document).width();
txt+="x" + $(document).height() + "n";
txt+="Window width/height: " + $(window).width();
txt+="x" + $(window).height();
alert(txt);
});
});
</head>
<body>
<button>Display dimensions of document and window</button>
</body>
</html>
head 标签
之前缺少结束<script>
标签
右边。 缺少</script>
替换以下内容
</head>
<body>
由
</script>
</head>
<body>