8
I have 2 files:
index.html
iframe.html
The archive index.html
has an iframe(iframe.html
).
There is a javascript function in the file index.html
function testePai(){
console.log("teste da função");
}
How do I call this function testePai()
from existing javascript in the file iframe.html
?
Good @Rgio, otherwise I had never really seen it work. A while ago I got into it, researched it but had not found a solution that worked well.
– Erlon Charles
@Erloncharles yes, and using jQuery for example is alone:
$('#myIframe')[0].contentWindow.minhaFuncao()
– Sergio
Okay... you used jQuery practically just replacing the query selector js, then continued with pure js. That would be a mixed solution then, hehe. Still a good.
– Erlon Charles