簡體   English   中英

在IE11中,當我為每個on元素數組使用時,Symbol.Iterator提供錯誤?

[英]In IE11 Symbol.Iterator is giving error when i am using for each on array of elements?

我試圖循環一個按鈕數組並在運行時創建react component按鈕,該錯誤僅在IE 11中可再現,我在Symbol中遇到錯誤。 迭代器,這意味着我傳遞的數組無效,並且無法返回內部迭代器,但這在任何其他瀏覽器上都可以正常工作,是否是IE的問題,或者我正在使用jQuery選擇器來獲取按鈕數組。

export default function(buttons){

   for(let button of buttons){
       //Code for creating button as react component button.
   }
}

//call to replaceButtons


var btns = $('.continue-buttons');
replaceButtons(btns);

SYMBOL.ITERATOR出現錯誤

我知道這不是編寫響應代碼的優化方法,但是需求和設計是一個很大的挑戰。

jQuery不返回數組,而是返回jQuery集合。 確實這不是迭代的。 實際上是從v1.12 / v2.2開始。

但是, Internet Explorer 11根本不支持迭代器或for of循環

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM