求高人解答简单的javascript window.open问题,为什么打不开,参数为什么不起作用?
代码很简单,就是一个下拉菜单,点击选项打开新网页。问题如下:
1、我用IE浏览器点击下拉选项根本没反应,为什么?
2、用搜狗浏览器点击下拉选项可以打开新网页,但是新窗口和原窗口一样大,width、height、resizable=no根本不起作用,为什么?
求高人解答!
<!DOCTYPE html>
<html>
<head>
<title>script_windowdemo_01.html</title>
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=GB18030">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script language="javascript">
function openWin(myurl){
window.open(myurl,"open url","width=100,height=150,scrollbars=yes,resizable=no");
}
</script>
</head>
<body>
<form action="" name="form" method="post">
<select name="url" onChange="openWin(this.value)">
<option value="html_form.html">Board</option>
<option value="html_show01.html">Show</option>
<option value="script_basicdemo_01.html">Basic</option>
</select>
</form>
</body>
</html>
[解决办法]
<!DOCTYPE html>
<html>
<head>
<title>script_windowdemo_01.html</title>
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=GB18030">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript">
function openWin(myurl){
window.open(myurl,"TIPWindows","width=100,height=150,scrollbars=yes,resizable=no");
}
</script>
</head>
<body>
<form action="" name="form" method="post">
<select name="url" onChange="openWin(this.value)">
<option value="http://www.baidu.com">Board</option>
<option value="http://www.bing.com">Show</option>
</select>
</form>
</body>
</html>