window.open

1,打开一个新窗口,并控制其样式

<html>
<head>
<script type="text/javascript">
function open_win()
{
window.open("http://www.w3school.com.cn","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400")
}
</script>
</head>

<body>
<form>
<input type="button" value="打开窗口" onclick="open_win()">
</form>
</body>

</html>

2,打开一个新的窗口

window.open(url,"_blank");

3,打开一个新窗口,并覆盖上次打开的

window.open(url,'newwindow');

4,在本窗口打开

window.open(url,'_self');

posted @ 2013-07-22 18:12  KoMiles  阅读(293)  评论(0编辑  收藏  举报