我有一个iframe,需要捕获javascript变量中的src属性.这就是我的iframe的样子
<iframe id="iframe_module_46081" name="iframe_module_46081" src="//myurl.com/tabs/495/campaigns/0ed3ffa8-5050-4a18-a5e3-f348d12a1304?signature=6aa3005368f163539976460246f2f0839c0fb3e3&id=678326">
<script>$(document).ready(function(){
var name = window.name;
var src = ????;
})
</script>
</iframe>
Run Code Online (Sandbox Code Playgroud)
我可以通过window.name获取名称,但不能通过src属性获取名称.任何的想法?
Ale*_*lov 18
如果跨域检查允许,请尝试window.frameElement.src.否则,你运气不好,独自一人location.href.
| 归档时间: |
|
| 查看次数: |
14193 次 |
| 最近记录: |