我如何将使用javascript传递宽度,高度,调整大小的值作为参数传递给window.open?
由于
实施例
function poponload(mywidth,myheight,resizeVal)
{
testwindow = window.open ("http://www.yahoo.com", "mywindow","location=1,status=1,scrollbars=1,width=+mywidth+,height=myheight,resizeVal");
testwindow.moveTo(0,0);
}
<body onload="javascript: poponload(200, 500,yes)">
答案 0 :(得分:5)
function poponload(mywidth,myheight,resizeVal) {
testwindow= window.open("http://www.yahoo.com", "mywindow", "location=1,status=1,scrollbars=1,width="+mywidth+",height="+myheight+",resizable="+resizeVal);
testwindow.moveTo(0,0);
}
然后你应该为resizeVal传入“1”或“0”,如下所示:
<body onload="poponload(200,500,1)">
进一步阅读:
答案 1 :(得分:3)
testwindow= window.open ("http://www.yahoo.com", "mywindow","location=1,status=1,scrollbars=1,width="+mywidth+",height="+myheight+",resizeVal");
使用此处查看字符串连接
答案 2 :(得分:0)
此外,body onload="javascript: poponload(200, 500,yes)"
只有一个javascript:
。