简体   繁体   English

从自身获取iFrame location.href

[英]get iFrame location.href from it self

I have an iFrame and I want to get the location.href of this, not from parent, but from it self. 我有一个iFrame,我想从我自己那里而不是父母那里获得这个location.href。 Here the code where i want to get this: 这是我想得到的代码:

var scanForUrl = "<script>window.setInterval(function(){ parent.postMessage( //Location Href of iFrame// , '*'); }, 2000);</script>";

I don't know if it's possible, I entrust to you. 我不知道有没有可能,我托付给你。

Thanks in advance 提前致谢

iframe使用src属性而不是href

let source = $("iframe").attr("src");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM