onclick使用JS在新窗口中打开表格



toggleSideBar在<td>下面打开列,但我想在使用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>

你可以使用windows .open

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>");
}

在新打开的文档上生成table的方法

听起来你在寻找Javascript的窗口。打开命令

阅读更多关于它(看各种例子)在这里:http://www.htmlgoodies.com/beyond/javascript/article.php/3471221

最新更新