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!
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With