Jump to content
Jeffy

Linking within iframes

Recommended Posts

I think i have a unique situation that someone might be able to help me with. on my website when a link is clicked within an iframe it of course opens it in that iframe but my ultimate goal is for it to open the link and open another page in a seperate iframe at the same time. i guess you could consider it double linking? is there a way to do this?

Share this post


Link to post
Share on other sites
I think i have a unique situation that someone might be able to help me with.  on my website when a link is clicked within an iframe it of course opens it in that iframe but my ultimate goal is for it to open the link and open another page in a seperate iframe at the same time. i guess you could consider it double linking? is there a way to do this?

<a href="file_name.html" target="frame_name" onclick="window.open('http://www.somewebsite.com')">Clicky, clicky...</a>

Share this post


Link to post
Share on other sites

heres more of a visual to what i am talking about 1=iframe 12=iframe 2-------------------------------////////--------------------------------------------////////--------------------------------------------////////----------------------11111---------------////////---2222-----------------------------------////////--------------------------------------------////////--------------------------------------------////////-------------ok so i have somthing displayed in iframe 1 and when i click a link in it i want it to display the link in iframe1 aswell as another document in iframe 2, only using the one link though

Share this post


Link to post
Share on other sites

jonas thats the idea im looking for....didnt work exatly is there a way to get the onclick=window.open to open in itself by putting _self somewhere?

Share this post


Link to post
Share on other sites

will the page in frame 1 always load a certain page in frame two or visa versa?Is one page always going to be associated with the other?If so,Frame 1 could use the onload function in the body tag to load frame two. If frame 2 always has a certain page related to it loaded in Fram 1, then put the onload in frame 2If none of these is the case, then you will have to pass the second frame target in a URL parameter and have the onload function be dynamically generated (via, javascript, php, asp, or cold fusion).hope this helps

Share this post


Link to post
Share on other sites
can you tell me more about this onload attribute?

sure.The attribute is most commonly used in the <body> tag. Lets same that one of your Frame 2 pages is always supposed to have a particular page loaded in Frame 1 - then you would use something like this in the Frame 2 page:<body onLoad="frames[1].location.href= 'http://www.whatever.com.au'">If that code is in Frame 2 then you'll be able to the other page in Frame 1. There are a couple other ways you could manipulate the onload function if you are using cold fusion, php, or asp - even javascript - but that shoudl get you started.Let me know how it goes.

Share this post


Link to post
Share on other sites

Why don't you post it here Jeffy, so other people can see. You PM'ed me, so it felt natural to respond through PM, but really, everybody should get to see it. Not that it's the genious solution or anything...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...