When iFrame changes page
Is there any way you can fire a function when a iframe
has changed its page (load function), w开发者_如何学Goithout having to add anything to the iframe
content?
Thank you in advance.
I'm assuming the iframe contents are from another origin, in which case the answer is no. Browsers won't tell you the current URL of a child iframe unless its same-origin, so I don't think they'll fire an event when it changes.
Here's a demo which recognises when the first load event takes place, but doesn't log any subsequent page changes: http://jsfiddle.net/GPh6H/
精彩评论