使用window.open时IE 11打印空白页(IE bug) -

时间:2015-01-08 21:01:35

标签: javascript window.open

有人可以对这个奇怪的IE错误提出一些看法,试图打印所选的部分在所有浏览器上工作正常但是IE 11. IE打开空白页我也没有看到任何错误。花了几个小时进行这项研究并尝试不同的工作。

   events:{
        'click td.delete-cell .glyphicon.glyphicon-remove': 'removeRow',

        'click th.delete-cell .glyphicon.glyphicon-remove': 'removeAll',

        'click .print-button': 'printClicked'
    },

    printClicked: function() {
        var printHTML = $("<div></div>"), summaryTable, driverInfo, driverId;
        // If there is no Print Window open, or it was closed
        if ( !this.printWindow || !this.printWindow.window ) {
          this.printWindow = window.open('', this.options.device.attributes.displayName + " Parameters Report");

            $(this.printWindow.document.head).append(this.getTemplate(this.PrintCSSTemplate)());
            $(this.printWindow.document.body).addClass('PRINTMODE');

            driverId = this.device.get('driverId') ? parseInt(this.device.get('driverId'), 10) : null;
            driverInfo = this.drivers.findWhere({ driverId: driverId });

            printHTML.append(
                this.getTemplate(this.PrintSummaryDeviceOverviewTemplate)(_.extend({},
                    this.options.device.toJSON(),
                    { driver: driverInfo.toJSON() }
                ))
            );

            summaryTable = this.$('table').clone();
            summaryTable.find('.delete-cell').remove();
            summaryTable.appendTo(printHTML);

            printHTML.appendTo(this.printWindow.document.body);

            this.printWindow.print();

        }
    },

0 个答案:

没有答案