Here is the actual code:
function pdf(){ var widthImage = 400; var heightImage = 400; var newWin = open('','Печать','width='+ widthImage +',height='+ heightImage + ',status=no,toolbar=no,menubar=no,location=no,scrollbar=0,resizable=yes'); newWin.document.writeln('<html><head></head><body>pdf<hr><object><embed src=scr="www.bstu.ru/shared/attachments/82141" width="400" height="400" /></object></body></html>'); newWin.document.close(); newWin.focus(); //newWin.print(); //newWin.close(); } function jpg(){ var widthImage = 400; var heightImage = 400; var newWin = open('','Печать','width='+ widthImage +',height='+ heightImage + ',status=no,toolbar=no,menubar=no,location=no,scrollbar=0,resizable=yes'); newWin.document.writeln('<html><head></head><body>jpg<hr><img scr="www.dreempics.com/img/picture/Mar/25/9b1e838c79c65f22a6535a9a32a51387/mini_2.jpg"></body></html>'); newWin.document.close(); newWin.focus(); //newWin.print(); //newWin.close(); } <button onclick="pdf();">pdf</button> <button onclick="jpg();">jpg</button> The markup works fine, but the files are not displayed. What is the reason?
---- Updated ------
function pdf(){ var widthImage = 400; var heightImage = 400; var newWin = open('','Печать','width='+ widthImage +',height='+ heightImage + ',status=no,toolbar=no,menubar=no,location=no,scrollbar=0,resizable=yes'); newWin.document.writeln('<html><head></head><body>pdf<hr><object><embed src="http://www.bstu.ru/shared/attachments/82141" width="400" height="400" /></object></body></html>'); newWin.document.close(); newWin.focus(); //newWin.print(); //newWin.close(); } function jpg(){ var widthImage = 400; var heightImage = 400; var newWin = open('','Печать','width='+ widthImage +',height='+ heightImage + ',status=no,toolbar=no,menubar=no,location=no,scrollbar=0,resizable=yes'); newWin.document.writeln('<html><head></head><body>jpg<hr><img src="http://www.dreempics.com/img/picture/Mar/25/9b1e838c79c65f22a6535a9a32a51387/mini_2.jpg"></body></html>'); newWin.document.close(); newWin.focus(); //newWin.print(); //newWin.close(); } <button onclick="pdf();">pdf</button> <button onclick="jpg();">jpg</button> Now only the PDF file is not displayed. What could be the reason?