View Full Version : Navigate to an iframe anchor on a different page

02-02-2009, 06:50 AM
Hi there -
I need to be able to click a link on one page that will navigate to a certain anchor that is contained inside an iframe on the next page. I.E. user clicks "SERVICES" on index.html --> needs to nav to products.html#services which is the contents of an iframe on a page called index2.html. Not sure if this can be accomplished with javascript or not. Thanks for any help you can provide.

02-02-2009, 07:52 AM
The simplest solution would be to just link to the anchor in the iframe like you would link to a normal page and then set the target to that iframe:

<a href="/products.html#services" target="productsIframeName">Products</a>

Good luck!

02-02-2009, 06:14 PM
Thanks for your quick reply however...the iframe is contained on the next page. I.E. index1.html has the navigation, index2.html has the information which is contained in the iframe products.html and is controled by anchors. So the user clicks a link on index1.html that has no iframe, and is taken to index2.html, where the requested information is displayed at the top of the iframe products.html.