【发布时间】:2013-02-28 23:06:24
【问题描述】:
谁能告诉我这个sn-p有什么问题?
<!DOCTYPE html>
<html>
<head>
<script>
function anotherWindow(msg, myWidth, myHeight)
{
theWindow=window.open('','','width=myWidth,height=myHeight');
theWindow.document.write(msg);
theWindow.focus();
}
</script>
</head>
<body>
<input type="button" value="One more window" onclick="anotherWindow('Here is the window',200,100)" />
</body>
</html>
当第一个参数 (msg) 成功传递给方法 .write 时,方法 .open 中与窗口大小相关的两个参数没有结果——该方法坚持一些默认值。
我对变量传递的理解有什么问题?
【问题讨论】:
标签: javascript