PDA

View Full Version : scripting links to load content into multiple iframes



andrewsteinmetz
10 Sep 2007, 01:44 PM
Hi!
I'm using JavaScript links to load content into multiple iframes on the same page, and to dynamically resize the iframes to fit the content. This was working fine, until I put the navigation links themselves into a frame as well, so that i could load multiple different link lists into the page without a refresh or a change in url. The problem I'm having is that in Safari (it's working fine in Firefox) the links no longer work. It seems that within the frame, they're no longer able to target other frames in the page.

I guess my question is this: How can I get links in one frame to recognize other frames on the same parent page?

Below is the simple script I'm using for the links.

<script language="JavaScript" type="text/javascript">
function loadframe(url,target)
{
parent.frames[target].location.href = url;
}
</script>

I think the problem is that Safari isn't identifying index.html as the parent element, but rather, the document containing the set of navigation links.

Anybody know a solution?

Thanks,
Andrew