Javascript-форум (https://javascript.ru/forum/)
-   Javascript под браузер (https://javascript.ru/forum/css-html/)
-   -   печать страницы (https://javascript.ru/forum/css-html/24411-pechat-stranicy.html)

mcavalon 29.12.2011 00:40

печать страницы
 
ребята помогите пожалуйста!
нужно при нажатии на кнопку печатать страницу, все работает, НО в IE не пашет:( :( :(
делаю так
function print_page(){
  var p = window.open('../admin/entity/action/print.php');
  p.document.write('Период: ' + document.getElementById('field_id_0').value + ' - ' + document.getElementById('field_id_1').value,document.getElementById('print_top').innerHTML, document.getElementById('print_div1').innerHTML, '');
//                p.print();
if (navigator.appName == "Microsoft Internet Explorer")
{
     var PrintCommand = '<object ID="PrintCommandObject" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
     document.body.insertAdjacentHTML('beforeEnd', PrintCommand);
     PrintCommandObject.ExecWB(6, -1);
     PrintCommandObject.outerHTML = "";
}
else {
    p.print();
}         
            }


заранее благодарен


Часовой пояс GMT +3, время: 20:09.