Print Preview with javascript not function
<p>I have a problem with the print preview with javascript and asp.net mvc. 
I take the data of a search and passes the data via JSON to a JavaScript function: </p>

<pre><code>function preview (content) ( 
             debugger; 
             var result = content.get_response (). get_object (); 
             var json = eval (result); 
             var w = window.open ( 'Stampa.aspx', "Research Press", "height = 1200, width = 1000, status = yes, toolbar = no, menubar = no, location = no"); 
            w.document.open (); 

             HeadPrint + = "&lt;table border=1&gt;"; 
             CreateTableRicercaHead (); 
             CreateTableRicercaMain (JSON) 
             FootPrint + = "&lt;/ table&gt;"; 

             var node = w.document.createTextNode (HeadPrint + + strPrint Footprint); 
             alert (node.data); 
             var divPrint = w.document.getElementById (PrintDocument); 
             / / divPrint.innerHTML = HeadPrint + + strPrint footprint; 
             divPrint.appendChild (node); 
             alert (divPrint.appendChild (node)); 

  CreateTableRicercaMain function (data) ( 
             for (var list in data.r) ( 
                 strPrint + = "&lt;tr&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. UserID; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Surname; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Name; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Way; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Telephone; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. common; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Cap; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Province; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. CF; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Data_Versamento; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. IdOperatore; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Amount; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Data_inserimento; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Note; 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. causal 
                 strPrint + = "&lt;/ td&gt;"; 
                 strPrint + = "&lt;td&gt;"; 
                 strPrint + = data.r [list]. Nr_CC; 
                 strPrint + = "&lt;/ td&gt;"; 
             ) 

         ) 


         CreateTableRicercaHead function () ( 
             HeadPrint + = "&lt;tr&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "UserID"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Name"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Name"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Street"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Phone"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "common"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Cap"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Province"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Cf"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Data_Versamento"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "IdOperatore"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Amount"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Data_inserimento"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Notes"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Cause"; 
             HeadPrint + = "&lt;/ th&gt;"; 
             HeadPrint + = "&lt;th&gt;"; 
             HeadPrint + = "Nr_CC"; 


HeadPrint + = "&lt;/ th&gt;"; 
         HeadPrint + = "&lt;/ tr&gt;"; 
     )
</code></pre>

<p>and how 
  you can see I try to write the result in a div with innerHTML method, because if you write it with document.write () I noticed that with the data of a certain size (4000) the display is 1 minute.
, but the problem is that when I open the popup, I do not display anything is white, also if I right click-> View HTML I'm not seeing anything.Can you help me to resolve this issue?</p>
