IFRAME and links

Discussion in 'Programming' started by calisonder, May 5, 2007.

  1. #1
    normally, when a link in an iframe is clicked, the new page loads up inside that iframe.

    i have an iframe that is part of my navagation. how to i make it where someone can click the link in the iframe, but it loads up in the main page.



    please see example pic


    i think there is a simple short javascript????

    thanks
     

    Attached Files:

    calisonder, May 5, 2007 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,838
    Likes Received:
    4,542
    Best Answers:
    123
    Trophy Points:
    665
    #2
    no need for javascript... just code your links like this
    <a href="/newpage.php" target="_top">click me</a>
    Code (markup):
     
    sarahk, May 6, 2007 IP
  3. Tibiacity

    Tibiacity Active Member

    Messages:
    190
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    With _target the name of your frame.
     
    Tibiacity, May 8, 2007 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,838
    Likes Received:
    4,542
    Best Answers:
    123
    Trophy Points:
    665
    #4
    _top sends the page to the top of the browser - as the OP wants. No need to specify the frame name.
     
    sarahk, May 8, 2007 IP
  5. calisonder

    calisonder Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks a lot
     
    calisonder, May 8, 2007 IP