我正在尝试重新载入我的iframe,然后回滚到之前重新载入之前的位置。重新载入iFrame成功函数
var iframe_x=$('#the-frame').attr("xpos");
var iframe_y=$('#the-frame').attr("ypos");
$('#the-frame').attr("src", $('#the-frame').attr("src"));
document.getElementById('the-frame').contentWindow.scrollTo(iframe_x,iframe_y);
问题是我们需要等待iFrame在滚动前完成加载。 attr是否有'成功'的功能?
我该如何做到这一点?
如果相同的域,那么你有'document.getElementById('the-frame')。onload = function(){code here; }' –