Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Html Editors Enhanced-html > Re: window.prin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 40 of 112
Post > Topic >>

Re: window.print and iframe

by "Lamberti Fabrizio" <lambu@[EMAIL PROTECTED] > Jun 3, 2004 at 03:32 PM

Thanks.

My problem was solved by your suggestion.

"DU" <drunclear@[EMAIL PROTECTED]
> wrote in message
news:c9gvca$m92$1@[EMAIL PROTECTED]
> Lamberti Fabrizio wrote:
>
> > Hi all,
> > I've got this problem.
> >
> > I've an ASP file, named content.asp, with inside an input button and a
> > iframe that loads another asp file, named iframe.asp
> >
> > I'd like printing iframe.asp using the button inside content.asp.
> >
> > The size of iframe object inside content.asp is smaller than the real
size
> > of iframe.asp so I can't use JSCRIPT code window.print for the input
button.
> >
> > How can I solve my problem ?
> >
> > regards
> >
> >
>
>
> Assuming you have this markup in your content.asp file:
>
> <p><button type="button" onclick="PrintIframe();">Print the content of
> the iframe</button></p>
> <iframe name="IframeName" src="iframe.asp" ...></iframe>
>
> then in your <head> include this:
>
> <script type="text/javascript">
> function PrintIframe()
> {
> frames["IframeName"].focus();
> frames["IframeName"].print();
> }
> </script>
>
> 1- Note that content.asp and iframe.asp must share the same domain
> otherwise you'll be prevented to print because of the scripting across
> domain security constraint:
> "when loading a document from one origin, a script loaded from a
> different origin cannot get or set specific properties of specific
> browser and HTML objects in a window or frame"
>
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/guide/sec.html#1015705
>
> 2- Last time I checked this issue (~ 6 months ago or so), Opera 7.x was
> not printing iframe but this could have been fixed since then. The code
> works for NS 7.x, Mozilla 1.3+, MSIE 6.
>
> DU




 3 Posts in Topic:
window.print and iframe
"Lamberti Fabrizio&q  2004-05-26 23:59:12 
Re: window.print and iframe
DU <drunclear@[EMAIL P  2004-06-01 00:06:41 
Re: window.print and iframe
"Lamberti Fabrizio&q  2004-06-03 15:32:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 7:16:45 CDT 2008.