且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检测iFrame是否被重定向到另一个URL?

更新时间:2023-01-08 09:39:00

您可以使用jQuery的加载函数来激活onload或reload。

You can use jQuery's load function that fires onload or reload.

http://api.jquery.com/load/

您需要存储iframe重新加载的次数。

You will need to store the number of times the iframe has reloaded.

类似的东西,

var reloaded = 0;
$("#iframe_id").load(function(){
    reloaded++;
});