javascript - Window.print() does not work -


Why does not this work? Loading page only is not printing here I take the source of an iframe and open that URL in a new window. var myDivObj = document.getElementById ('Resume Documents'). Src; Var somexml = '& lt; Html & gt; & Lt; Title & gt; Resume & lt; / Heading & gt; Body onload = "window.print ();" & Gt; & Lt; Iframe style = "height: 1000px; width: 1260px;" Src = "'+ myDivObj +" "/> gt; & Lt; / Body & gt; & Lt; / Html & gt; '; Var printwindow = window.open ('', '_blank', 'fullscreen = yes'); Printwindow.document.write (someXml); Printwindow.onload = function () {printwindow.self.focus (); Printwindow.self.print (); };

  var url = document.getElementById ('restart document'). Var printwindow = window.open ('', '', 'fullscreen = yes'); Printwindow.document.write ('& lt; iframe width = "100%" height = "100%" onload = "window.print ()" src =' + url + '& gt; & lt; / iframe & gt; ');    

Comments