Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

window.focus() is needed before calling window.print() in IE(in frames)

843835Nov 21 2001 — edited Jul 31 2002
window.focus() is needed before calling window.print() in IE(in HTML frames).

I had two frames(frame1 & frame2) and in the first frame i had a "Print" href link and when i click on it, i am supposed to print the content of the frame2 which sits near to frame1.

When i called parent.frame2.print(), it was printing the frame1 content instead of frame2 content in IE. It did work correctly in NE. Then we figured it out that it needs focus using parent.frame2.focus() and then tried the print() method.

parent.frame2.focus();
parent.frame2.print();

It worked this time.....Hope it saves some time for u guys.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2002
Added on Nov 21 2001
1 comment
225 views