当 jquery is is is noconflict mode 时如何解决 TypeError iterator is not a function with prototypejs

How to solve TypeError iterator is not a function with prototypejs when jquery is is noconflict mode

我有 designed a page,其中 jquery 与 Prototypejs 等其他库一起工作,因此我将 jquery 置于无冲突模式。 然而,当我调整 window 大小时,firebug 给我以下通知

TypeError: iterator is not a function[Learn More] prototype.js:859:7 forEach self-hosted:265:9 each http://iusefaith.com/js/prototype/prototype.js:859:7 compressEvent http://iusefaith.com/design/design1/app/common/assets/js/cache/front-2017073101.min.js:6579:13 http://iusefaith.com/design/design1/app/common/assets/js/cache/front-2017073101.min.js:6575:1

我认为我已经将 jquery 设置为正确的 noConflict 模式。这是我在无冲突模式下的 javascript 代码

<!-- include javascript --> 
<!-- Placed at the end of the document so the pages load faster -->
<script  src="js/jquery/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
$.noConflict();
</script>
...
<script src="js/prototype/prototype.js" type="text/javascript"></script>
 ...
<script src="design/design1/app/common/assets/js/cache/jquery-plugin-2017073101.min.js"></script>         

<script src="design/design1/app/common/assets/js/cache/front-2017073101.min.js"></script>

我对这种类型的错误很陌生,所以请 How to solve TypeError iterator is not a function with prototypejs when jquery is is is is noconflict mode ?

我认为这是您正在使用的调整大小 javascript 中非常具体的 problem/bug 但是 - 这修复了您的 js 错误

windowResizeClass

的compress方法中front.js的第6579行

更改方法的内容
    for (var k in windowResizer.resizeHandlers) {
        windowResizer.resizeHandlers[k]()
    }

    windowResizer.resizeHandlers.each(function(item){
            item();
    });