CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Iframe help

  1. #1
    Join Date
    Jan 2006
    Location
    Tel Aviv, Israel
    Posts
    53

    Iframe help

    How do i connect 2 different iframes using one link?
    Attached Files Attached Files

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Iframe help

    Do you mean click a link and the two pages go to separate URLs?

    If so, you need JavaScript.

    Code:
    <iframe id="frame1"></iframe>
    <iframe id="frame2"></iframe>
    
    <script language="JavaScript">
    function gotoURLs(url1, url2){
      document.getElementById('frame1').src = url1;
      document.getElementById('frame2').src = url2;
    }
    </script>
    
    <a href="#" onclick="gotoURLs('http://www.google.com','http://www.yahoo.com')">Google and Yahoo</a>
    EDIT: Forgot the function
    Last edited by PeejAvery; October 24th, 2006 at 09:36 AM.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured