开发者

JQuery parent functions from iframe to document

Trying to update content from an iframe on the main document via JQuery load. This does not work, how would one do it.

window.parent.$("#OPTthumb").lo开发者_StackOverflow中文版ad("http://www.divethegap.com/update/admin/dtg-settings/ #OPTthumb");

Any ideas?

Marvellous

THESE DON'T WORK

parent.$('#OPTthumb').load("http://www.divethegap.com/update/admin/dtg-settings/ #OPTthumb");

$('#OPTthumb', window.parent.document).load("http://www.divethegap.com/update/admin/dtg-settings/ #OPTthumb");


don't use window.parent, use parent. If you're executing this jQuery in the iframe, use this syntax:

parent.$('#OPTthumb').load("http://www.divethegap.com/update/admin/dtg-settings/ #OPTthumb");

-edit- Forgot one thing: for this to work you have to have jquery included in the main page, not necessary in the iframe.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜