开发者

Check all checkboxes inside an iframe (when inviting guests to a facebook event)

i'm trying to check all checkboxes when inviting guests to a facebook event. Facebook has changed something i think beacuse i usually used this code and now it is not working:

var elms=document.getElementsByName("checkableitems[]");
var lunghezza = elms.l开发者_如何学JAVAength;
for (i=0;i<lunghezza ;i++){if (elms[i].type="checkbox" )elms[i].click()};

I discovered that the modal windows to invite guests is inside an iframe but i can't checkboxes inside it!

I've used

jQuery('iframe#iframe_sbx_id').find('input[type=checkbox]').click()

but it doesn't work because find() returns an empty set. Any idea on how to do it?


You could use contents() to access the content of the iframe, but because it's on another domain, it won't work:

The .contents() method can also be used to get the content document of an iframe, if the iframe is on the same domain as the main page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜