問題タブ [printthis]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
jquery - jquery - iframe access denied in IE on some pages
I'm the author of printThis, a jquery plugin for printing.
https://github.com/jasonday/printThis
I have a user that has brought up an issue, that I have been unable to crack and unfortunately, I am unable to share the page (privacy concerns).
On the user's site, the issue presents on some pages in IE, but not others. The print is failing to happen, as the iframe remains empty.
The error in IE is within jQuery:
Using logging, I was able to determine it was failing around this line:
But again, this only happens on some pages and I have been unable to recreate in any instance outside of this user's site.
My question: Is there a better approach here? or a method to make the $doc object more bulletproof?
UPDATE
Issue to due to document.domain
This type of page has document.domain set and IE does not inherit document.domain from the parent.
To fix that portion, I changed the iframe creation to standard javascript and set the source to write document.domain on iframe creation.
So this fixes the access denied, however now the frame won't print. I've tried a lot of different methods for accessing the object, however none of them are working.
A) how would you access the frame in this scenario (i've tried most of the methods outlined on SO) to get IE to recognize and print
or
B) can anyone think of a better way to get the document.domain into the iframe on creation with jQuery? (can't be afterwards, as the access denied issue will come up)
javascript - 非表示の div メソッドを使用して空白ページをプリンターに送信する
非表示の可視性を使用して複数ページのフォームを表示することがわかったコード スニペットを使用しています。私の問題はすべてこの方法に起因する可能性が非常に高いです。そのリソースはここからのものでした: http://www.devx.com/webdev/Article/10483/0/page/2
フォームの複数のページを表示するのはかなり簡単な方法です...おそらく、印刷できるようにすることを意図したものではありません。
「Print App」ボタンは printThis プラグインを適切に呼び出しています。ただし、page1 DIV セクションからコンテンツを取得できません。印刷されるのは、右上の通常のヘッダー部分 (ページ 1 の 1) と、ページの左下の空白とページの右下の約: 内容ではありません。
これは、page2 のコンテンツが表示されているときに、page1 の DIV が「非表示」に設定されているためだと思います。ボタン呼び出しで「page2」を代入すると、期待どおりに page2 からコンテンツを取得します。
だから...私が求めているのは、printThisボタンの呼び出しで参照されているDIVを一時的に変更して、ページ印刷を実行するのに十分なだけ長く見えるようにする方法だと思います。
何か案は?
jquery-plugins - コールバック jquery プラグイン printThis
この検索とグーグルを使って解決策を見つけようとしましたが、何も見つかりませんでした。助けていただければ幸いです。
ページの一部のみを印刷するためにprintThisプラグインを使用しています(私の場合はDIV =モーダルダイアログ)。プラグインページ: https://github.com/jasonday/printThis
print-dialog が呼び出されてドキュメントを印刷した後、モーダル ダイアログを自動的に閉じたいのですが、コールバック関数が必要です。
それで、それは印刷のために働いているコードです:
今、コールバックを「キャッチ」するjqueryから「done()」関数を追加したと思いました...次のことを試しましたが、うまくいきませんでした:
プル リクエストで何かを見つけました: https://github.com/jasonday/printThis/pull/28 しかし、それをどのように使用できるかわかりません。
printThis (v 1.4) と jquery (v 1.11.0) の最新バージョンを使用しています。
どうもありがとうございます。
乾杯、マルコ
jquery - Firefox での長い画像の最後の部分の印刷がスキップされる
私はprintThis.jsで作業しています。IE と Chrome では正常に印刷されますが、Firefox では画像の下部が印刷されません。私は何が欠けていますか?このJS Fiddleを参照してください
これが私がこれまでに行ったことです
jquery - 「printThis」はテーブルと div を同じページに印刷できますか?
printThis Jquery プラグインを使用しています。表を印刷するのに使っています。しかし今、テーブルの下に div を追加したいと思います。それは可能ですか?
私のコードは、テーブルと div を 2 つの別々の用紙に出力します。
HTML
JS
php - 「PrintThis」を「改ページ」に強制する方法
Jquery プラグイン "PrintThis" を使用すると、
html 関数:が機能<div style='page-break-after:always'></div>
しなくなります。さて、「PrintThis」は改ページしません!
どうすればこれを解決できますか?
JSで「ブレークライン」を入れるべきですか? どのように?
同じテーブル ID を使用しても問題ありませんか?
HTML
JS