Javascript 使用JS在新窗口中单击“打开表”

Javascript 使用JS在新窗口中单击“打开表”,javascript,Javascript,toggleSideBar打开下面的列,但我想使用JS在新窗口中打开它 <input type="button" id="togglebox" value="List Annotations" onclick="toggleSideBar()" /> <td id="PaneContainerRight" class="rightpanel-div-right" style="display: none"> <div id="annotationPanel

toggleSideBar打开
下面的列,但我想使用JS在新窗口中打开它

<input type="button" id="togglebox" value="List Annotations" onclick="toggleSideBar()" />

<td id="PaneContainerRight" class="rightpanel-div-right" style="display: none">
    <div id="annotationPanel" class="PanelEntry">
        <ul class="taskpanel touch" id="CommentPanel">
            <div class="annotationPanelTitleBar">
                <span class="taskPaneTitle" id="CommentPanelTitle">Annotations</span>       
            </div> 
            <div>
                <form style="display:block">
                    <input type="text" placeholder="Search for">
                    <input type="submit" value="Submit" style="visibility: hidden">
                </form>
            </div>
            <div id="listComments" style="height: 200px; width: 300px; overflow: auto;">
                <table id="ListTable"></table>
            </div>
        </ul>
    </div>
</td>

    注释

听起来像是在寻找Javascript的window.open命令

请在此处阅读更多信息(参见各种示例):

您可以使用

函数myFunction(){
var myWindow=window.open(“,”MsgWindow“,”宽度=200,高度=100”);
myWindow.document.write(“这是‘MsgWindow’。我宽200像素,高100像素!

”; }

在新打开的文档上创建
表的方法。

toggleSideBar()是什么样子的?如果我正确理解您的问题,您正在查找window.open()。虽然链接可能包含答案,但最好在您的答案中发布相关代码。虽然此链接可能回答问题,但最好在此处包含答案的基本部分,并提供链接供参考。如果链接页面发生更改,仅链接的答案可能会无效。@Raidri-添加了一小段代码。也许现在你可以取消你的否决票了:(
function myFunction() {
    var myWindow = window.open("", "MsgWindow", "width=200, height=100");
    myWindow.document.write("<p>This is 'MsgWindow'. I am 200px wide and 100px tall!</p>");
}