print(), iframe, IE 5/6

D

Daniel Loose

Hi!

I have an iframe on my page and a button. When the button is clicked,
a html page containing some text is loaded into the iframe, and I want
the print dialog do be run automatically, in order to print that text.
For that, I have put

window.onload=function() {
parent.iframename.focus();
parent.iframename.print();
}

into the same page containing the text. It works great in IE 7, FF 2,
Opera 9. But it does not in IE 5-6!! Why?? How can I get it to work??
nothing happens at all, not even an error message. Thank you *very*
much!!

Daniel
Marty - it's perfect! You're just not thinking fourth dimensionally!
[Emmett "Doc" Brown]

If you wish to email me, please use newsreply at wuwei minus webservices dot de
 
D

David Mark

Hi!

I have an iframe on my page and a button. When the button is clicked,
a html page containing some text is loaded into the iframe, and I want
the print dialog do be run automatically, in order to print that text.
For that, I have put

window.onload=function() {
parent.iframename.focus();
parent.iframename.print();

}

Interesting. I suppose you have an IFrame with an id of
"iframename." I am surprised your code works in anything but IE.
Seems to me that this would work as well:

window.onload = function() {
window.focus();
window.print();
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top