---
title: "javascript window.open()详解"
author: "zwfc"
date: "2008-12-26T16:21:00Z"
tags: []
slug: "javascript-window-open"
draft: false
lastmod: "2008-12-26T16:21:00Z"
id: 470942
url: "https://zwfc.iteye.com/blog/470942"
---

window.open()有四个参数。

参数1：url

参数2：target或名字，可以是frame的name

\_self :\_parent \_top \_blank

参数3：a string of features(用，分割在，=前后不能有空格)

left : number

top : number

height : number

width : number

resizable : yes,no

scrollable : yes,no

toolbar : yes,no

status : yes,no

location : yes,no

参数4：布尔值，是否替换本窗口。默认false

如下这段代码将不能执行，因为，和=前后有空格。

window.open(“http://www.wrox.com/”, “wroxwindow”,  
“height=150, width= 300, top=10, left= 10, resizable =yes”);

改成这样就可以正常执行。

window.open(“http://www.wrox.com/”, “wroxwindow”,  
“height=150,width=300,top=10,left=10,resizable=yes”);