1
我想提出一個iframe的內容到一個div,然後調用在同一個iframe中,但父頁上聲明的函數:調用iframe中聲明和父頁面上設置一個功能
$('#myframe').load(function(){
var myfunc = this.contentWindow.iframefunc; <- the function is set successfully
$('#mydiv').html($($(this).contents()[0]).find('body').html());
myfunc(); <- not working
});
是否在不同的域上的iframe?如果是這樣,你將遇到同源政策問題。 – reedlauber 2012-03-28 13:12:06
是的,它在同一個域中 – rekans 2012-03-29 19:29:46