|
|
 |
Re: FN-FORUM: Page and Iframe test please
date posted 1st March 2005 12:13
Leon
Thank you very much for the pointers and script. First time I have needed
to determine the height of the IFrame so I also used some code from the net,
but if this works for you I will definitely give it a go.
Thanks
Emma
----- Original Message -----
From: "Leon Chevalier" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Tuesday, March 01, 2005 5:05 AM
Subject: RE: FN-FORUM: Page and Iframe test please
>
> Hi,
>
> I'm using IE6 on a PC and when I click one of the links the page starts to
> load in the iframe, and once it has fully loaded it produces the following
> javscript error:
>
> Line: 9
> Char: 1
> Error: Unspecified Error
> Code: 0
> URL: http://monkhousemarketing.co.uk/banners.htm
>
> I have used this technique before myself, but rather than use javascript
> links for each of the frames you can just link to the iframe in the normal
> way, with the target set as the iframe name. This will load the page in
> the
> iframe. Then, in the Iframe page itself you have this code:
>
> function resizeIframe(id) {
>
> frame = parent.document.getElementById(id);
>
> // Get the document within the frame. This is where you will fail
> with 'permission denied'
>
> // if the document within the frame is not from the same domain as
> this
> document.
>
> // Note: IE uses 'contentWindow', Opera uses 'contentDocument',
> Netscape uses either.
>
> innerDoc = (frame.contentDocument) ? frame.contentDocument :
> frame.contentWindow.document;
>
> // Resize the style object, if it exists. Otherwise, resize the frame
> itself.
>
> objToResize = (frame.style) ? frame.style : frame;
>
>
> // Resize the object to the scroll height of the inner document body.
> You may still have
>
> // to add a 'fudge' factor to get rid of the scroll bar entirely. With
> a plain-vanilla
>
> // iframe, I found Netscape needs no fudge, IE needs 4 and Opera needs
> 5...
>
> // Of course, your mileage may vary.
>
> objToResize.height = innerDoc.body.scrollHeight + 5;
>
>
> } // end function
>
> and resizeIframe('nameoftheiframe'); set to activate onload.
>
> I got this code from the net - can't remember from where - but it always
> works for me. Very simple and effective!
>
> Cheers,
>
> Leon
>
> -----Original Message-----
> From: [EMAIL REMOVED] [EMAIL REMOVED] Behalf Of Emma
> Davis
> Sent: 25 February 2005 09:20
> To: FN-FORUM / [EMAIL REMOVED]
> Subject: FN-FORUM: Page and Iframe test please
>
>
> Can anyone take a look and let me know what they get please.
>
> Cheers
> Emma
>
>
>
>
>
>
> --
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
> |
 |
|