Results 1 to 7 of 7

Thread: Double-Target Hyperlink? -Somewhat Urgent-

  1. #1
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Double-Target Hyperlink? -Somewhat Urgent-

    Hi, I'm new to Javascript, and so far know next to nothing at it, yet I need to add a thing to my site which requires a double-target hyperlink. I figured this would probably need Javascript, which is why I'm posting here. The first frame with the most important link is called mainFrame, while the second frame (actually an iframe) is called details. They need to go to two seperate URL's when the link-image is clicked. I appreciate any assistance, thank you for your time.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Is 'mainFrame' also an iframe? Is 'details' in the same frame as the page with the link? Is 'mainFrame'? Anyways, if 'mainFrame' is an actual frame (or an iframe in the same frame or on the same html page as the link) and 'details' is an iframe in the same frame or on the same html page as the link, this will do nicely:
    HTML Code:
    <a href="some.htm" target="mainFrame" onclick="window.details.location.href='someother.htm';return true;"><img src="link.jpg" border="0"></a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Umm, there's a frameset with two frames, one on top, one on bottom (the menu), in the menu part there's a small iframe which needs to be targetted at the same time as the menu changes the main frame.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Should work then, if not:
    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Moderators/staff can lock this topic now, after patiently searching 14 different search engines I was able to find my answer. Thanks for your help jscheuer1, the problem was that it said error on page when I clicked the link, and it didn't target the 'details' iframe.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    My code tested out here in a simple demo I constructed. What was your final arrangement?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Uhh, instead of windows.details part I used windows.parent[#], the number is the number of the frame (first frame in the code would be 0, second would be 1, etc.). The reason why it probably didn't work was because I had the frame resizer script from dynamic drive enabled on it, probably interfered or something, that's all I can guess...

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
  •