diff --git a/Ilia Rostovtsev b/Ilia Rostovtsev new file mode 100644 index 0000000..fe0e4ac --- /dev/null +++ b/Ilia Rostovtsev @@ -0,0 +1,134 @@ +(function ($) { + var opt; + $.fn.printThis = function (options) { + opt = $.extend({}, $.fn.printThis.defaults, options); + var $element = this instanceof jQuery ? this : $(this); + + var strFrameName = "printThis-" + (new Date()).getTime(); + + if(window.location.hostname !== document.domain && navigator.userAgent.match(/msie/i)){ + // Ugly IE hacks due to IE not inheriting document.domain from parent + // checks if document.domain is set by comparing the host name against document.domain + var iframeSrc = "javascript:document.write(\"\")"; + var printI= document.createElement('iframe'); + printI.name = "printIframe"; + printI.id = strFrameName; + printI.className = "MSIE"; + document.body.appendChild(printI); + printI.src = iframeSrc; + + } else { + // other browsers inherit document.domain, and IE works if document.domain is not explicitly set + var $frame = $("