博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
javascript window.open
阅读量:4641 次
发布时间:2019-06-09

本文共 6527 字,大约阅读时间需要 21 分钟。

翻译原文:

open method
Opens a new window and loads the document specified by a given URL.
Navigates the app window to the specified location.
Syntax
var retval = window.open(url, name, features, replace);
Parameters
url [in, optional]
    Type: String
    String that specifies the URL of the document to display. If no URL is specified, a new window with about:blank is displayed.
name [in, optional]
    Type: String
    String that specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.
    _blank
        The url is loaded into a new, unnamed window.
    _parent
        The url is loaded into the current frame's parent. If the frame has no parent, this value acts as the value _self.
    _self
        The current document is replaced with the specified url.
    _top
        The loaded url replaces any framesets that might be loaded. If there are no framesets defined, this value acts as the value _self.
features [in, optional]
    Type: String
    String that contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported.
    channelmode = { yes | no | 1 | 0 }
        Specifies whether to display the window in theater mode. The default is no.
        Internet Explorer 7. channelmode = { yes | 1 } overrides height, width, top, and left values. When active, the Navigation Bar is hidden and the Title Bar is visible. The Channel Band is no longer supported in Internet Explorer 7.
        In Internet Explorer 6, channelmode = { yes | 1 } displays the Channel Band in theater mode.
    fullscreen = { yes | no | 1 | 0 }
        Specifies whether to display the browser in full-screen mode. The default is no. Use full-screen mode carefully. Because this mode hides the browser's title bar and menus, always provide a button or other visual clue to help the user close the window. ALT+F4 closes the new window.
        Internet Explorer 7. A window in full-screen mode doesn't need to be in theater mode.
        In Internet Explorer 6, a window in full-screen mode must also be in theater mode (channelmode).
    height = number
        Sets the height of the window in pixels. The minimum value is 150, and specifies the minimum height of the browser content area.
        In Internet Explorer 6, the minimum height value is 100.
    left = number
        Specifies the left position, in pixels. This value is relative to the upper-left corner of the screen. The value must be greater than or equal to 0.
    location = { yes | no | 1 | 0 }
        Specifies whether to display the Navigation Bar. The default is yes.
        In Internet Explorer 6, location specifies whether to display the Address Bar.
        The Back, Forward, and Stop commands are now located in the Navigation Bar.
        In Internet Explorer 6, the navigation commands were located in the toolbar.
    menubar = { yes | no | 1 | 0 }
        Specifies whether to display the Menu Bar. The default is yes.
        Internet Explorer 7. By default, the menu bar is hidden unless revealed by the ALT key. menubar = { no | 0 } prohibits the Menu Bar from appearing even when the ALT key is pressed.
        The combination of menubar = { no | 0 } and toolbar = { no | 0 } hides the toolbar and disables any additional third-party user interfaces.
    resizable = { yes | no | 1 | 0 }
        Specifies whether to display resize handles at the corners of the window. The default is yes.
        Internet Explorer 7. resizable = { no | 0 } disables tabs in a new window.
    scrollbars = { yes | no | 1 | 0 }
        Specifies whether to display horizontal and vertical scroll bars. The default is yes.
    status = { yes | no | 1 | 0 }
        Specifies whether to add a Status Bar at the bottom of the window. The default is yes.
    toolbar = { yes | no | 1 | 0 }
        Specifies whether to display the browser Command Bar, making buttons such as Favorites Center, Add to Favorites, and Tools available. The default is yes.
        The combination of menubar = { no | 0 } and toolbar = { no | 0 } turns off the toolbar and any additional third-party user interfaces.
        In Internet Explorer 6, the toolbar sFeatures specifies whether to display the browser toolbar, making buttons such as Back, Forward, and Stop available.
    top = number
        Specifies the top position, in pixels. This value is relative to the upper-left corner of the screen. The value must be greater than or equal to 0.
    width = number
        Sets the width of the window in pixels. The minimum value is 250, and specifies the minimum width of the browsers content area.
        In Internet Explorer 6, the minimum height value is 100.
        
翻译
open 方法
    打开一个新窗口并加载给定URL指定的文档。
    导航应用程序窗口到指定的地址。
语法
    var retval =window.open(url, name, features, replace);
参数
    url[in,可选]
        类型:字符串
        此字符串,指定要显示文档的URL。如果没有指定URL,将打开一个新的空白窗口。
    name [in,可选]
        类型:字符串
        此字符串,指定窗口的名称。这个名字被用作窗体或超链接(锚)元素的目标属性的值。
    _blank
        此url将被加载到一个新的、不愿透露姓名的窗口。
    _parent
        此url将被加载到当前窗口的父窗口。如果没有父窗口,将加载其自身窗口。
    _self
        当前文档被替换为指定的url。
    _top
        加载当前窗口地址的url替换任何可能被加载的框架集。如果没有定义框架集,将加载其自身窗口。
    features [in,可选]
        类型:字符串
        此字符串包含一个由逗号分隔的项目列表。每个条目包含由一个等号分隔的选项和值(例如,“fullscreen=yes, toolbar=yes”)。
        支持以下值。
        channelmode = { yes | no | 1 | 0 }
            指定是否在影院模式下显示窗口。默认是否定的。
            Internet Explorer 7.channelmode = { yes | 1 }重载 height, width, top, 和left的值 。当窗口活动时,导航栏隐藏并且标题栏可见。通道带模式在Internet Explorer 7不再支持。
            在Internet Explorer 6中,channelmode = {yes| 1 }在影院模式下显示通道带模式。
        fullscreen = { yes | no | 1 | 0 }
        
            指定是否显示浏览器全屏模式。默认是否定的。谨慎地使用全屏模式。因为这种模式隐藏浏览器的标题栏和菜单,总是提供一个按钮或其他可视线索来帮助用户关闭窗口。ALT + F4关闭新窗口。
            Internet Explorer 7的一个窗口在全屏模式下不需要影院模式。
            在Internet Explorer 6中,一个窗口在全屏模式也必须在影院模式下(通道带模式)。
        height = number
            设置窗口的高度(以像素为单位)。最小值为150,指定浏览器内容区域的最低高度。
            在Internet Explorer 6中,最小高度值为100。
        left = number
            指定左边的位置,以像素为单位。这个值是相对于屏幕的左上角。该值必须大于或等于0。
        location = { yes | no | 1 | 0 }
            指定是否显示导航栏。默认是肯定的。
            在Internet Explorer 6中,指定是否显示地址栏位置。
            后退,前进,停止命令现在都位于导航栏。
            在Internet Explorer 6中,导航命令位于工具栏。
        menubar = { yes | no | 1 | 0 }
            指定是否显示菜单栏。默认是肯定的。
            Internet Explorer 7。默认情况下,菜单栏隐藏,除非显示ALT键。menubar = { no | 0 }禁止菜单栏在窗口显示即使按下ALT键。
            menubar = { no | 0 }和toolbar = { no | 0 } 组合隐藏工具栏和禁用任何其他第三方的用户界面。
        resizable = { yes | no | 1 | 0 }
            指定在窗口的角落是否显示手控重新设置大小。默认是肯定的。
            Internet Explorer 7的resizable = { no | 0 }禁用标签在一个新的窗口。
        scrollbars = { yes | no | 1 | 0 }
            指定是否显示水平和垂直滚动条。默认是肯定的。
        status = { yes | no | 1 | 0 }
            指定是否要在窗口底部添加一个状态栏。默认是肯定的。
        toolbar = { yes | no | 1 | 0 }
            指定是否显示浏览器命令栏,操作按钮等,比如收藏中心,添加到收藏夹,和显示工具栏。默认是肯定的。
            menubar = { no | 0 }和toolbar = { no | 0 }组合起来可关闭工具栏和任何其他第三方的用户界面。
            在Internet Explorer 6中,工具栏特征指定是否显示浏览器工具栏,操作按钮等,比如后退,前进,停止。
        top = number
            指定顶部的位置,以像素为单位。这个值是相对于屏幕的左上角。该值必须大于或等于0。
        width = number
            设置窗口的宽度(以像素为单位)。指定浏览器内容区域的最小宽度,最小值为250。
            在Internet Explorer 6中,最小高度值为100。

转载于:https://www.cnblogs.com/lovesy2413/p/4441848.html

你可能感兴趣的文章
LoadRunner常用术语
查看>>
关于jedis2.4以上版本的连接池配置,及工具类
查看>>
记忆讲师石伟华微信公众号2017所有文章汇总(待更新)
查看>>
mechanize (1)
查看>>
FactoryBean
查看>>
Coolite动态加载CheckboxGroup,无法在后台中获取
查看>>
如何在我们项目中利用开源的图表(js chart)
查看>>
nfs服务器工作原理
查看>>
C3P0连接池工具类使用
查看>>
SVN常用命令备注
查看>>
孩子教育
查看>>
解决Cacti监控图像断断续续问题
查看>>
结构体的传参理解成员的存储方式
查看>>
python 进程与线程(理论部分)
查看>>
什么是API
查看>>
Java反射中method.isBridge() 桥接方法
查看>>
[shiro学习笔记]第二节 shiro与web融合实现一个简单的授权认证
查看>>
强名称程序集(strong name assembly)——为程序集赋予强名称
查看>>
1028. List Sorting (25)
查看>>
BZOJ 1613: [Usaco2007 Jan]Running贝茜的晨练计划
查看>>