Search code examples
phpiframehyperlinkhref

Move to iFrame target on click


I'm currently trying to make an Information Point Kiosk for my GCSE IT Project, and one of the pages consists of a news page, based on an RSS input.

This is what I have so far:

<script language="JavaScript" src="http://feed2js.org//feed2js.php?src=http%3A%2F%2Ffeeds.bbci.co.uk%2Fnews%2Frss.xml&desc=1&targ=story&utf=y"  charset="UTF-8" type="text/javascript"></script>

and further down the page:

<td><a id="story"><iframe name="story" width="960px" height="450px"></iframe></a></td>

The thing is, as the iframe is further down the page, I want the link from the news item to load in the iframe (which it does) but also automatically move the page to the iframe location at the same time, hence the hyperlink id in the iframe table cell.

How can I do this?


Solution

  • <a href='test.html' target='story'>TEST</a>
    
    <iframe name="story" width="960px" height="450px"></iframe>