HTML & WEB-Design

Moderators: Jonathan
Number of threads: 1249
Number of posts: 3348

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Changing the source of an IFrame from the parent URL Posted by mwronski on 11 Jan 2005 at 5:39 AM
I have an iframe in my page. I would like its source to change to another page when a user clicks on a block of text in the main page.

<div onClick="I.src='2.htm'; return true;">Click here to change page in IFRAME!</div>
<iframe name="I" src="1.htm"></iframe>

doesnt work. help please...
Report
Re: Changing the source of an IFrame from the parent URL Posted by Weirdofreak on 11 Jan 2005 at 10:21 AM
If you change the name to an ID, you can run
document.getElementById('I').setAttribute('src', 'new URL');
^D
$ shameless-plug
http://line-ed.sourceforge.net




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.