View Full Version : Printing from inside the iframe
10-29-2008, 07:17 PM
I have an iframe which needs to be printed. What is the proper way of printing the inside content of the iframe, through a link Inside this iframe?
10-30-2008, 10:18 AM
I would assume that you'd have to do it from inside the iframe. you could just add:
to the iframes page and that should work
10-30-2008, 04:12 PM
I tried this really fast because I was interested to see if you could print from outside the iframe:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
if (document.getElementById(n).print) document.getElementById(n).print();
else if (window.frames[n].print) window.frames[n].print();
else if (top.frames[n].print) top.frames[n].print();
<br /><br />
<iframe name="my_iframe" id="my_iframe" src="http://www.google.com"></iframe>
What I found:
- the DOM object reference doesn't contain a print function
- the frames array reference does contain a print function, but I get "Access Denied" in IE and "Permission Denied" in FF, which makes sense
Looks like you'll need to add the link to the iframed page itself (as dusty suggested).
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.