admin管理员组

文章数量:1289565

Onclick of a anchor tag i am giving window.print(); call and I get the print pop-up. But on the click of print I get the following script error.

An error occurred in the script on this page.
Line: 2115
Char: 1
Error: Your file waiting to be printed was deleted.
Code: 0
URL : res://ieframe.dll/preview.js

Do you want to continue with the script on the page(yes/no buttons)

May what ever you click Yes/No I don't get the print or in IE8 i get a blank print.

Firefox prints fine. But, fails in IE9.

Can some one help me on this one??

Onclick of a anchor tag i am giving window.print(); call and I get the print pop-up. But on the click of print I get the following script error.

An error occurred in the script on this page.
Line: 2115
Char: 1
Error: Your file waiting to be printed was deleted.
Code: 0
URL : res://ieframe.dll/preview.js

Do you want to continue with the script on the page(yes/no buttons)

May what ever you click Yes/No I don't get the print or in IE8 i get a blank print.

Firefox prints fine. But, fails in IE9.

Can some one help me on this one??

Share Improve this question edited Jun 5, 2012 at 14:51 Zuul 16.3k6 gold badges62 silver badges88 bronze badges asked Jun 5, 2012 at 14:42 user942309user942309 611 gold badge1 silver badge6 bronze badges 3
  • Do you want to post some code? Windows.Print is supported by all major browsers. Post some code. – Hituptony Commented Jun 5, 2012 at 14:44
  • Please provide your code which executes JavaScript, it's impossible to guess what is wrong. – Wirone Commented Jun 5, 2012 at 14:45
  • Very, very long discussion about the same problem: social.technet.microsoft./Forums/en/ieitprocurrentver/thread/… – powtac Commented Jun 5, 2012 at 15:10
Add a ment  | 

3 Answers 3

Reset to default 6

You can also get this error in IE10 if you are calling window.close() immediately after window.print(), especially if your DOM is large. My guess is that the page has not finished rendering when IE10 executes the window.print() call.

You can therefore get around this issue by:

  • Calling window.close() within a hover event on the page. A print dialgue will steal the user's focus, so the hover event wont fire until the user has finished dealing with the dialogue. We found this to be the best solution.
  • Not calling window.close() at all for IE10 clients
  • As window.print() does not have a callback, calling window.close() after an arbitrary delay. I wouldn't remend this as it will be unreliable
  • Go "nuclear" with this answer, which loads the html into a hidden iFrame before printing, sidestepping the need to call window.close()

Follow this two Microsoft help articles:

  • http://support.microsoft./kb/973479
  • http://support.microsoft./kb/2652062

At least it seems to be a problem with print driver and or problems with add ons installed in the IE. An other solution is to be uninstall IE 9 and reinstall it.

I ended up replacing/upgrading the printer driver on the server end, removing the printer on the desktop client and recreating the printer via the handy UNC path (double \ which doesn't show here) \server\printer" add method.

本文标签: javascriptWindowprint() error in IE in resieframedllpreviewjsStack Overflow