开发者

When iFrame changes page

开发者 https://www.devze.com 2023-04-03 06:54 出处:网络
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?

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消