Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes HTML, CSS and JavaScript and the fly likes My littel print function works in IE but not Mozilla any ideas  ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "My littel print function works in IE but not Mozilla any ideas  ?" Watch "My littel print function works in IE but not Mozilla any ideas  ?" New topic
Author

My littel print function works in IE but not Mozilla any ideas ?

Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
I have this function that print a image, works fine in IE 8.0, its shows the image in a new window and i can print the image.

But when i use Mozilla FireFox 3.6 i can see the image in my in a new window, but its only prints "About:blank"




Frank
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The following code is 100% untested. I think this will work better. Fist you preload the image, than you create an iframe, you print the iframe, and than you remove it.



Eric
Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
Hmm, i tried to copy paste this in to my page, and the script runs fine, but nothing happens in IE and Mozilla, then i used the old fasion way
puts a lot off alerts into the kode, if i could find a bug somewhere, but all the javascript executes ....
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Well with your code, you need to wait until the image is fully loaded. You can do that by just using a timeout and waiting a a second before calling print.

Eric
Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
I just want to add the solution i used, maybe someone else can use this, i works in IE and FireFox




Nice always to get quick respond in this forum

// Frank
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My littel print function works in IE but not Mozilla any ideas ?
 
Similar Threads
Image load on IE is getting problem
window.opener
Rezize image when printing, what to do ?
Printing Pop up window
Simple animated GIF ? - Why preloading doesn't work in IE