how to make my javascript iframes a link?

Discussion in 'JavaScript' started by Jen-, Sep 14, 2006.

  1. #1
    How do I make it so the when you click on the Iframe url it goes to the online url address.

    Right now the url is
    non clickable.

    I am sure you do this somehow by also making it a link, but not sure how.
    This is how the url looks in the array.

    content[1] = "http://www.reciprocallink.com/mission.html";
    I am sure I need to include it in my document write statement. But not sure how so it is turns it into an actual link. Thank you very much. :) Jen
     
    Jen-, Sep 14, 2006 IP
  2. Jen-

    Jen- Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Actually that wouldn't even matter so much if the web url would appear somewhere, or if there was a text link to click on instead. I could do it separately with the iframe and the link to it rotating at the same time, but would rather not key two sets of information into separate scripts. Was hoping I could include them both into one. Thanks
     
    Jen-, Sep 14, 2006 IP
  3. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Are you sure you want to use iframes and javascript for navigation on your website? The search engines will hate it.
     
    mad4, Sep 14, 2006 IP
  4. Jen-

    Jen- Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes, this isn't for my whole web site. Just for a page application I want to use this on. Thanks!
     
    Jen-, Sep 15, 2006 IP
  5. VONRAT

    VONRAT Banned

    Messages:
    181
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    are you referring to something like this???

    <script>
    function GoUrl(objFrame, newUrl) {
    objFrame.src = newUrl;
    }
    </script>

    <a href="#" onclick="GoUrl(whatever,'http://newpage1.com')">newpage1</a>
    <a href="#" onclick="GoUrl(whatever,'http://newpage2.com')">newpage2</a>

    <iframe id="whatever" src="http://whatever.com"></iframe>
     
    VONRAT, Sep 15, 2006 IP