【问题标题】:onload function on iframe is getting called twice in IE11iframe 上的 onload 函数在 IE11 中被调用两次
【发布时间】:2016-11-17 07:39:25
【问题描述】:

我在 html 中有一个 iframe,其中有一个 onload 函数。在 IE11 中,onload 函数被调用了两次,而在 chrome 中它工作正常。

HTML:

   <iframe src="someurl" onload="someFunction()"></iframe>

JS:

 function someFunction() {

   $window.scroll(0, 0);

   if (count > 0) {
       $ctrl.iframeHeight = '1000px';
       $scope.$digest();
   }

   return count++;

 }

someFunction() 在 IE11 中被调用了两次。

【问题讨论】:

  • someFunction() 里面有什么?可能会造成一些冲突。
  • 显示你的代码你在someFunction()里面写了什么。所以我们可以帮助你。

标签: javascript html angularjs iframe


【解决方案1】:

我认为应该检查您页面上的 JavaScript 文件/库参考。可能是因为一个js文件引用被添加了两次。

当 jquery ajax js 文件引用被添加两次时,我遇到了类似的 ajax 调用问题。

请检查您是否有类似的问题。

【讨论】:

    猜你喜欢
    • 2019-08-23
    • 2013-03-30
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-03
    • 2013-07-02
    • 1970-01-01
    相关资源
    最近更新 更多