SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2004
    Location
    LV-426
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hyperlink with two actions.

    I have a dream that one day this nation will rise up and let me have a hyperlink that not only updates the iframe it is in, but another iframe at the same time!

    Basically, one hyperlink with two actions (just changing pages for the iframe the link is in, and another iframe).

    Any ideas?

  2. #2
    SitePoint Zealot Valera Selev's Avatar
    Join Date
    Apr 2004
    Location
    Lviv, Ukraine
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This might help:

    Iframeset:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
    </head>
    <body>
    <iframe id="first" src="iframe.html"></iframe>
    <iframe id="second"></iframe>
    </body>
    </html>
    iframe.html:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
    </head>
    <body>
    <a href="" onclick="update();return false;">Update</a>
    <script>
    function update() {
      window.location.href="http://google.com";
      parent.document.getElementById('second').src="http://yandex.ru";
     }
    </script>
    </body>
    </html>

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ...Lord a mighty, free at last...

    <a href="other_iframe_url" target="foo" onclick="self.location='this_iframe_url'">link</a>
    .............
    <iframe id="foo" name="foo"..........>
    ::: certified wild guess :::

  4. #4
    SitePoint Member
    Join Date
    Jul 2004
    Location
    LV-426
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot guys.


Bookmarks

Posting Permissions

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