Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Text that activates two different links??

    I have a page which has two separate iframes. I know how to use target="iframename", but i want to have one link that changes both frames, and the code
    Code:
    <a href="lalala1.html" target="iframe1"><a href="lalala2.html" target="iframe2">link text</a></a>
    doesn't work. Is there any way to do this, or is it a lost cause? Is there maybe a way to use a javascript function? (If javascvript is solution, sorry that this is in wrong topic.)
    Last edited by xskybirdx; 08-15-2009 at 10:49 PM. Reason: Fixing Typo in Code

  • #2
    Regular Coder Kristofa's Avatar
    Join Date
    Jun 2009
    Location
    Leicester
    Posts
    143
    Thanks
    7
    Thanked 20 Times in 20 Posts
    I'm not sure if it would work anyway, but there is a typo in what you posted above. Is that exactly what you tried to use?

    Code:
    <a href="lalala1.html" target="iframe1"><a href="lalala2" target="iframe2">link text</a></a>
    If not, javascript would work.
    Learning along the way...

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    What you have will not work. You would need to use javascript, at least for the second link.
    Code:
    <a href="lalala1.html" target="iframe1" onclick="window.frames['iframe2'].location = 'lalala2.html'">link text</a>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    xskybirdx (08-15-2009)

  • #4
    New to the CF scene
    Join Date
    Aug 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Kristofa View Post
    I'm not sure if it would work anyway, but there is a typo in what you posted above. Is that exactly what you tried to use?

    Code:
    <a href="lalala1.html" target="iframe1"><a href="lalala2" target="iframe2">link text</a></a>
    If not, javascript would work.
    Oh, oops . But, no, I checked and the what I tried to use was 'correct', but the text only linked to the second, inner target (lalala2 in example).

  • #5
    New to the CF scene
    Join Date
    Aug 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    What you have will not work. You would need to use javascript, at least for the second link.
    Code:
    <a href="lalala1.html" target="iframe1" onclick="window.frames['iframe2'].location = 'lalala2.html'">link text</a>
    Thank you so much!


  •  

    Tags for this Thread

    Posting Permissions

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