We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5d7b6e3 + c07cf11 commit 8b1d33bCopy full SHA for 8b1d33b
src/hiprint/plugins/jquery.hiwprint.js
@@ -1,5 +1,6 @@
1
(function ($) {
2
$.fn.hiwprint = function (options) {
3
+ var hasLoaded = false;
4
var usedFrame = document.getElementById('hiwprint_iframe');
5
if (usedFrame) usedFrame.parentNode.removeChild(usedFrame);
6
var opt = $.extend({}, $.fn.hiwprint.defaults, options);
@@ -23,6 +24,8 @@
23
24
$iframe[0].srcdoc = '<!DOCTYPE html><html><head><title></title><meta charset="UTF-8">' + css + '</head><body></body></html>';
25
26
$iframe[0].onload = function () {
27
+ if (hasLoaded) return;
28
+ hasLoaded = true;
29
var printDocument = $iframe[0].contentWindow || $iframe[0].contentDocument;
30
if (printDocument.document) printDocument = printDocument.document;
31
if (!$iframe.attr('srcdoc')) {
0 commit comments