开发者

find out if iframe url has been changed

Is there开发者_如何学C a way for me to find out if the URL in my iframe has been changed, ie, the user has navigated somewhere? Thanks.


A similar question over here has some answers that should help you out. If you keep track of where the iframe starts, you can then use the methods in that link to see if it has changed.


yourIframeName.onbeforeunload = function () {
  //do something
}

This will trigger your function just before navigating to another page on iframe.

This behaves weird on somebrowsers though.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜