javascript jQuery - 在同一域上重定向后获取 iframe 的 URL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3696605/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 01:59:08  来源:igfitidea点击:

jQuery - Get URL of iframe AFTER redirection on same domain

javascriptjqueryhtmliframe

提问by Matthew H

Using Jquery, how can I get the URL of an iframe after redirection has occurred to a URL in the same domain?

使用 Jquery,如何在重定向到同一域中的 URL 后获取 iframe 的 URL?

回答by Fenton

The suggestion from sunn0 should work with this slight amendment.

sunn0 的建议应该与这个轻微的修正一起工作。

 $("#iframeid").load(function(){
    alert(this.contentWindow.location);
 });