I am trying to call a javascript function inside a iframe.
This is a test before to attempt to include a external geolocalization html code:
The HTML component calls the first iframe function ( iframe1.html) then calls the second iframe function( iframe2.html).
The link Do It calls the functions on the parent frame, iframe1 and iframe2.
When used inside the HTML component it calls the iframes, but when I trying to call the Do It link it does not work. Inspector shows the following error:
Localizador.html:1Blocked a frame with origin "http://appery.io" from accessing a frame with origin "http://www.is3d.com.br". Protocols, domains, and ports must match.
Here is the code inside the HTML Component
<!--
<html
<head
<script type="text/javascript"
function parent_function()
{
alert('parent');
}
function doit() {
parent_function();
document.getElementsByTagName('iframe')[0].contentWindow.iframe1_function();
document.getElementsByTagName('iframe')[0].contentWindow.document.getElementsByTagName('iframe')[0].contentWindow.iframe2_function();
}
</script
</head
<body
main
<a href="javascript:doit();"do it</a
<iframe src='http://www.is3d.com.br/clientes/guiap...'
</body
</html
--
----------------------------------------------------This is the iframe1.html page Code:
<!--
<html
<head
<script type="text/javascript"
function iframe1_function() {
alert('iframe1');
}
</script
</head
<body
frame1
<iframe src='iframe2.html'
</body
</html
--
This is the iframe2.html code:
<!--
<html
<head
<script type="text/javascript"
function iframe2_function() {
alert('iframe2');
}
</script
</head
<body
frame2
</body
</html
--