我试图在iframe加载新页面(可能通过用户单击链接)触发的父级上设置事件。当iFrame中的新页面加载时发生jQuery事件
HTML:
<iframe name="posts" id="posts" src="edit.php">
JS:
$(document).ready(function() {
$('iframe#posts').live('load', function() {
console.log('live');
});
});
的问题是,console.log()
声明从未被触发。我怎样才能实现我想要做的?
老派'
@dosboy是有道理的,如果丹的猜测是正确的。 iframe仍然会在文档之前触发。 – cregox 2011-04-15 21:21:03