Reputation: 4349
Is it possible to click a link on an external site that's loaded in an iframe, using a JavaScript? The link is:
<a href="#" onclick=Center.Add('micro1')>micro</a>
<div id="frameContainer"></div>
<script type="text/javascript">
onload=function(){
var el=document.getElementById("frameContainer")
el.innerHTML="<iframe border=\"0\" scrolling=no src=\"http://example.com/en-US/My/Pro?tag=micro1\"></iframe>"
}
</script>
Upvotes: 0
Views: 730
Reputation: 5167
The page loaded in the iframe is from a different domain? You want to execute JavaScript in the child frame from the parent frame? If so, then the answer is no. Security issues prevent cross-domain JavaScript.
There are work-arounds if both pages are "yours". But if not then the answer is a definite no.
Upvotes: 3