Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / August 2005



Tip: Looking for answers? Try searching our database.

dynamic src of IFRAME

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
seans - 30 Aug 2005 14:36 GMT
Hi,

Please, can somebody help me with this? I have two iframes. The
contents of the first iframe are changed dynamically at run time. I
want to take the contents of the first iframe and display them in the
second iframe. Is it possible to do this? I tried using the following
code:

function getLframe() {

    return parent.frames['frame1']
}

function getLframedoc() {                        return (getLframe()).document
}

str = (getLframedoc()).documentElement.outerHTML
document.all.iframe2.src = str

but all I get is the message "Bad Request (Invalid URL)" displayed in
the second frame. Is it possible to do this or must the string be a
file/url?

thanks again.

sean
Danny - 29 Aug 2005 08:53 GMT
       documentElement is read-only and is at the document. level:

  document.documentElement
       and make sure both iframes are in the same domain, there's no access on
crossdomains objects.

                               Danny
Randy Webb - 31 Aug 2005 06:59 GMT
seans said the following on 8/30/2005 9:36 AM:

> Hi,
>
> Please, can somebody help me with this? I have two iframes. The
> contents of the first iframe are changed dynamically at run time. I
> want to take the contents of the first iframe and display them in the
> second iframe. Is it possible to do this?

Yes. If the first IFrame is changed dynamically at run time, have
whatever mechanism is dynamically changing it to dynamically change the
second one.

>  I tried using the following code:
>
[quoted text clipped - 11 lines]
> the second frame. Is it possible to do this or must the string be a
> file/url?

Looks like a whole lot of trouble to produce IE only code.

See above.

Signature

Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly

seans - 31 Aug 2005 10:31 GMT
> seans said the following on 8/30/2005 9:36 AM:
>
[quoted text clipped - 32 lines]
> Randy
> comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly

Thanks to both of you for your help.

sean
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.