Php 无法在iframe内获取html,也无法在iframe内激发元素的事件
我正在使用FacebookGraphAPI邀请Facebook朋友访问我的codeigniter应用程序,我想在iframe元素中触发一个单击事件,但它没有触发,我的代码是Php 无法在iframe内获取html,也无法在iframe内激发元素的事件,php,javascript,jquery,codeigniter,facebook-graph-api,Php,Javascript,Jquery,Codeigniter,Facebook Graph Api,我正在使用FacebookGraphAPI邀请Facebook朋友访问我的codeigniter应用程序,我想在iframe元素中触发一个单击事件,但它没有触发,我的代码是 $("iframe").contents().find('input[name="login"]').live('mouseover',function(){ alert("log in"); }); 未显示警报,firebug中没有错误
$("iframe").contents().find('input[name="login"]').live('mouseover',function(){
alert("log in");
});
未显示警报,firebug中没有错误
但如果我这样做
$("iframe").live('mouseover',function(){
alert("log in");
});
这会起作用并发出警报
但是如果我尝试在iframe中获取html
$("iframe").live('mouseover',function() {
alert($('.fb_ltr').contents().find('.request').html());
});
it gives an error in firebug
Permission denied to access property 'ownerDocument'
[Break On This Error] shift(),i.sort());if(!!e&&!f.event.cus...is).get();f(e[h])[b](j),d=d.concat(j
如何使用iframe中的元素,我看到了类似的问题,但没有得到帮助。请提供帮助,谢谢。…..如果任何内容来自不同的域,您将无法通过iframe访问/操作任何内容
如果内容来自不同的域,则无法通过iframe访问/操作任何内容
Iframe被视为单个元素 这就是为什么您的代码:
$("iframe").live('mouseover',function(){});
可以工作,但访问其元素则不行
看到这个了吗
Iframe被视为单个元素 这就是为什么您的代码:
$("iframe").live('mouseover',function(){});
可以工作,但访问其元素则不行
看到这个了吗