【发布时间】:2015-01-27 19:02:06
【问题描述】:
iframe 中有一个与 angularjs http 服务一起使用的页面。它会加载一些数据并为页面中的每个 li 放置 id。所以最终的 html 页面看起来像这样:
<li id="1000" ....>....</li>
<li id="1001" ....>....</li>
<li id="1002" ....>....</li>
<li id="1003" ....>....</li>
..
..
<li id="1020" ....>....</li>
这个页面在 iframe 中,所以我会像下面这样滚动父 iframe : ($scope.mid exits in li's id )
$q.all(promises)
....
})).then(function() {
$("#divLoading").hide();
var iframe = parent.document.getElementById("ConverstionsListFrame");
iframe.location.replace(iframe.contentWindow.location + '#' + $scope.mid);
...}
所以上面的代码在 IExplorer 中运行良好,但在 firefox 中崩溃了,有时它工作,有时没有! 问题出在哪里 ?我认为也许 firefox 渲染队列与 IE 不同,这会导致 iframe 找不到锚 id,因为它还没有退出!请记录一下这个问题。
提前谢谢....
【问题讨论】:
标签: javascript jquery angularjs firefox iframe