open

400 阅读1分钟

windwo.open()

var btn= document.querySelector("button")
btn.onclick=function(){
    window.open("another.html","_blank")
}

Window.open():js打开新窗口的方法 语法:window.open(pageURL,name,para,eters) 例如:window.open("page.html","newWindow","height=100,width=400,top=0,left=0,toobar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no") "page.html":弹出窗口的文件名 "newwindow":弹出窗口的名字(不是文件名),非必须,可用空""代替 height:窗口高度 width:窗口宽度 top:窗口距离屏幕上方的像素值 left距离左边的像素值 toobar:是否实现工具栏 menubar,scrollbar表示菜单栏和滚动栏 location:是否显示地址栏 status:是否显示状态栏信息