Jump to content

Linking within iframes


Jeffy

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?

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>
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

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

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.
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...

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...