其实,我要的是window.open() 
产生一个新窗体所并把父窗体中一个panel传过新窗体。
并显示出来。
是如何实现。

解决方案 »

  1.   

    当前窗口里面的元素用   element.cloneNode(true);  
       
      其他窗口的元素嘛......  
       
      创建一个一样的元素:newPanel2=document.createElement(oldPanel1.outerHTML)  
      插入到当前窗口:obj.insertBefore(newPanel2)或者obj.appendChildnewPanel2)  
      obj为窗口中的一个容器元素,如td或span或div。
      

  2.   

    html没有panel这个东东吧var oldPanel1 = document.getElementById("Panel1");
    var newPanel2 = window.document.createElement("div");newPanel2.outerHTML = oldPanel1.outerHTML;
    window.document.body.appendChild(newPanel2);
      

  3.   

    var chartImage = document.getElementById("Panel1");
    // create a new window
    var newWindow = window.open("", "Chart", "height=350, width=450, location=no, toolbar=no, titlebar=no, resizable=no, status=no, menubar=no"); chartImage.cloneNode(true);  
    var newPanel2=document.createElement(chartImage.outerHTML); 
    newWindow.document.body.appendChild(newPanel2);这样不成啊。报错。
    不支持此接口。点解?
      

  4.   

    <script type="text/javascript">
    function PrintChart()
    {
        
    // reference the chart image
    var chartImage = document.getElementById("Panel1");
    chartImage.cloneNode(true);  
    // create a new window
    var newWindow = window.open("", "Chart", "height=350, width=450, location=no, toolbar=no, titlebar=no, resizable=no, status=no, menubar=no"); 
    var newPanel2=newWindow.document.createElement("Panel");
    newPanel2.outerHTML =chartImage.outerHTML;
    newWindow.document.body.appendChild(newPanel2);
    }
    </script>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Panel ID="Panel1" runat="server" Height="66px" Width="273px">
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <asp:Button ID="Button1" runat="server" Text="Button" /></asp:Panel>
            <br />
            
            <input type="button" value="Print" onclick="PrintChart()" />
        </div>
        <div id="div1"></div>
        </form>
    </body>这样没报错。但Panel1中有的控件在新窗体中没有出现。
      

  5.   

    panel在html中就是div
    var newPanel2=newWindow.document.createElement("Panel");
    --〉
    var newPanel2=newWindow.document.createElement("DIV");
      

  6.   

    改成这样:
    function PrintChart()
            {
                // reference the chart image
                var chartImage = document.getElementById("Panel1");    
                // create a new window
                var newWindow = window.open("a.aspx", "Chart", "height=350, width=450, location=no, toolbar=no, titlebar=no, resizable=no, status=no, menubar=no");
                var newPanel2=newWindow.document.createElement("div");
                newWindow.document.body.appendChild(newPanel2);
                newPanel2.innerHTML = chartImage.outerHTML;
            }