0

I want a link to open in an Iframe which already has its source tag linked to another page. The link and iframe are on same page. Here is the code:

<div>
<iframe src="itihaas1.php" id="wrapper" height="1000" width="800" frameborder="0" scrolling="no"><p>Your browser does not support iframes.</p></iframe>

    </div>
<div><a href="itihaas2.php" target="wrapper">Page 1</a></div>

If it's not possible then how can it be done? Any soln would do.

thanks.

appu
  • 127
  • 1
  • 9
  • is the link inside the page that the iframe is pointing to or on the parent page? – Dave Jul 25 '11 at 16:25
  • parent page. Parent page is a container page with an iframe tag that loads all external pages inside parent page. External pages have links to other external pages all opening in parent page iframe. – appu Jul 25 '11 at 16:29

1 Answers1

0

if you use jQuery you can do something like this:

<a href="something.html" id="myLink"></a>


<script>
$(function() {
$('#myLink').click(function() {
    var iframe = $('#myIframe');
    iframe.attr("src", "newpage.html");
});
});
</script>

if you are use plain javascript you should find your answer here: change iframe source in ie using javascript

Community
  • 1
  • 1
Dave
  • 3,812
  • 5
  • 31
  • 39