手动触发iFrame的onLoad事件 [英] Manually trigger onLoad event of iFrame
问题描述
我有两个不同的页面:主页面和第二页面(它将作为iFrame在主页面中显示)。
I have two different pages: the main page and the second page (that will be displayed in the main page as an iFrame).
事实是,我无法编辑主页面,除了来自iFrame href链接。
我想要做的是通过在第二页中使用jQuery手动触发主页面中的iFrameonLoad事件。
The fact is that I cannot edit the main page, except from the iFrame href link. What I want to do is to manually trigger the iFrame "onLoad" event in the main page, by using jQuery in the second page.
真正难以编辑主页的原因是,我设法做的唯一事情就是在第二页上手动触发就绪事件,但不幸的是,这与onLoad事件无关。
This is getting really hard cause of the impossibility to edit the main page, and the only thing I managed to do is to manually trigger the "ready" event on the second page, but this is not related to the "onLoad" event, unfortunately.
任何帮助将不胜感激。
在此先感谢。
Any help would be greatly appreciated. Thanks in advance.
推荐答案
试试
Try
parent.$("iframe[src=myhref]").trigger("onload");
这篇关于手动触发iFrame的onLoad事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!