Javascript iframe导航到书签位置,在firefox中不工作
iframe中有一个页面与angularjs http服务一起工作。它加载一些数据,并将每个li的id放入页面中。最后的html页面如下所示:Javascript iframe导航到书签位置,在firefox中不工作,javascript,jquery,angularjs,firefox,iframe,Javascript,Jquery,Angularjs,Firefox,Iframe,iframe中有一个页面与angularjs http服务一起工作。它加载一些数据,并将每个li的id放入页面中。最后的html页面如下所示: <li id="1000" ....>....</li> <li id="1001" ....>....</li> <li id="1002" ....>....</li> <li id="1003" ....>....</li> .. .. <li i
<li id="1000" ....>....</li>
<li id="1001" ....>....</li>
<li id="1002" ....>....</li>
<li id="1003" ....>....</li>
..
..
<li id="1020" ....>....</li>
因此,上面的代码在IExplorer中运行良好,但在firefox中崩溃,有时正常,有时无效!
问题在哪里?我认为firefox呈现队列可能与IE不同,IE导致iframe找不到锚id,因为它还没有退出!请给我记一些关于这个问题的笔记
提前感谢….此指令将解决
.directive('onLastRepeat', function () {
return function (scope, element, attrs) {
if (scope.$last) setTimeout(function () {
var iframe = parent.document.getElementById("ConverstionsListFrame");
iframe.contentWindow.location.replace(iframe.contentWindow.location + '#' + scope.mid);
}, 1);
};
})
.directive('onLastRepeat', function () {
return function (scope, element, attrs) {
if (scope.$last) setTimeout(function () {
var iframe = parent.document.getElementById("ConverstionsListFrame");
iframe.contentWindow.location.replace(iframe.contentWindow.location + '#' + scope.mid);
}, 1);
};
})