使用JS在新窗口中打开表

时间:2015-05-27 18:43:40

标签: javascript

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>

2 个答案:

答案 0 :(得分:1)

您可以使用Window.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

答案 1 :(得分:0)

听起来你正在寻找Javascript的window.open命令

在这里阅读更多相关信息(参见各种示例): http://www.htmlgoodies.com/beyond/javascript/article.php/3471221