i am using Facebook graph API to invite Facebook friends to my codeigniter application , i want to fire a click event inside an element of iframe , but it is not firing , my code is
$("iframe").contents().find('input[name="login"]').live('mouseover',function(){
alert("log in");
});
alert is not shown , no errors in firebug .
but if i do this
$("iframe").live('mouseover',function(){
alert("log in");
});
this works and give the alert .
but if i try to get html inside iframe
$("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] shi开发者_如何学Goft(),i.sort());if(!!e&&!f.event.cus...is).get();f(e[h])[b](j),d=d.concat(j
how to use elements inside iframe , i saw similar questions , but could not get a help . please help , thanks ..............................
You are unable to access/manipulate any content via iframe if it's from a different domain.
jQuery/JavaScript: accessing contents of an iframe
The Iframe is treated as a single element.
Thats why your code:
$("iframe").live('mouseover',function(){});
works but accessing its element won't
see this jQuery - Trying to select element from iFrame (point and click)
精彩评论