Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when the iframe getting reloaded?

i have an iframe in my page , and this iframe is not located on my server (src is not from my site).

how can i trigger a function as soon as the iframe getting redicrecting to a new target(src is changing)?

what i mean is when a user click on a link in the iframe and the iframe is redirecting him to the new target.. i need to trigger a function before it redirecting him , OR as soon as possible before the page is been showing up..

onclick and onload events get trigged when the iframe is getting fully loaded and that's not effective for me.

any advices could help!

like image 858
ixcese Avatar asked Nov 04 '22 05:11

ixcese


1 Answers

This can not be done due to the same origin policy.

On the other hand if you control the other site you can send cross domain messages, see: http://html5demos.com/postmessage2

like image 180
Daniel Kurka Avatar answered Nov 07 '22 23:11

Daniel Kurka