Reputation: 148
I have this code to open link in iframe and hide iframe until link is clicked then hide link after link is clicked
<script>
$(document).ready(function(){
$("#iframe1").hide();
$("#theLink").click(function(){
$("#iframe1").show();
$("#linkDiv").hide();
return false;
});
});
</script>
<div id="linkDiv">
<a href="http://www.example.com" id="theLink" target="iframe1">Link</a>
</div>
<br/><br/>
<iframe id="iframe1" name="iframe1" src="#"></iframe>
The link not load in the iframe
Can anyone solve this problem please ?
Thank you.
Upvotes: 0
Views: 70
Reputation: 943591
return false
cancels the default action so the link isn't followed. Take it out.
Upvotes: 1