在iframe中查找元素(外部域) [英] Find element inside an iframe (external domain)

查看:163
本文介绍了在iframe中查找元素(外部域)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法访问iframe中加载的元素?

Is there any way to access elements loaded inside an iframe?

我正在尝试这个但似乎不起作用:

I'm trying this but doesn't seem to work:

if($('#cboxLoadedContent iframe').contents().find('#customer-login')[0] ){ ... }


推荐答案

它工作了,我在本地打开了文件( file:// )内容加载了 http:// 协议。

It worked, I hd opened the file locally (file://) whereas the content was loaded with http:// protocol.

这篇关于在iframe中查找元素(外部域)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆