Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 8th, 2007, 01:52 PM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems getting same-domain IFRAME content

I have an invisible IFRAME, and a visible DIV:
Code:
<div id="text" style="z-index:90;" class="chatWindowTextDisplay"
title="Chat Transcript - "
alt="Chat Transcript -"
><iframe name="textFrame" id="textFrame" src="http://localhost/iframeContent.php?cmd=file&file=chatTemplate&template=chatText&amp;site=909076&amp;sessionkey=H9030219168890559071K46359640" frameborder="0" border="0" width="350" height="220" class="chatWindowTextFrame"
title="Chat Transcript - "
alt="Chat Transcript - "
>This functionality requires frames. </a>.</iframe>
</div>
invisable iframe:
Code:
document.writeln('<div id="hiddentext" style="z-index:0;position:absolute;visibility:hidden;left:0;top:13px">'+
    '<iframe name="lpCommFrame" id="lpCommFrame" src="http://localhost/iframecontent.php" frameborder="0" border="0" width="350" height="220" title="Background">'+
    'This functionality requires frames. </iframe>'+
'</div>');
I need to copy the content from the lpCommFrame IFRAME, into the textFrame iframe which is inside DIV. Everything
comes from the same domain, so there are definitely not any cross-domain security issues.

I was able to get the content of hidden iframe and display it in alert using this code:

                var win = window.frames['lpCommFrame'];
                var newtext = win.document.body.innerHTML;
                alert("textframe"+newtext);

But how to place that data in to my other frame which is called textFrame? i be happy if some one show me how to copy content of lpCommFrame frame to textFrame frame .Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with [iframe].location roccosiffredi Ajax 4 April 26th, 2007 07:42 AM
Problem with iframe content when refreshing page klax Javascript 0 April 21st, 2007 04:43 PM
Another one of those iframe(?) problems Anthem HTML Code Clinic 0 August 9th, 2006 11:42 AM
Application Domain problems sky_handsome C# 0 December 29th, 2005 04:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.