我試圖支持跨瀏覽器兼容性,但功能包括()不受IE(Internet Explorer)支持。有誰知道這是爲什麼?爲什麼Internet Explorer不支持includes()?
1
A
回答
2
Array.prototype.includes
和String.prototype.includes
分別是ES7 (now ES2017)和ES6 (now ES2015) javascript規範的一部分。
Internet Explorer的...是一個停產系列圖形Web瀏覽器
關鍵詞:停產。微軟現在只開發Edge。 IE瀏覽器仍然可以獲取安全更新,但不會再收到新的JavaScript更新或任何瀏覽器規範更新。
includes()
是無法在Internet Explorer支持,你能解釋我爲什麼?
Internet Explorer不支持Array.prototype.includes
或String.prototype.includes
,因爲Microsoft不再開發IE。這些規格是在微軟停止使用IE之後發佈的,因此它不會獲得這些功能。
別急
您仍然可以通過使用polyfills使用舊的瀏覽器新的JavaScript。可以使用core-js作爲polyfills的庫。
要在IE中使用includes(...)
,只需在您的<head>
的頂部包含此項,然後再使用任何腳本。
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/core.min.js"></script>
相關問題
- 1. 不支持Internet Explorer jquery
- 2. Internet Explorer(IE)支持
- 3. 對Internet Explorer的Mediaelement.js支持
- 4. Internet Explorer 11支持converse.js嗎?
- 5. window.postMessage Internet Explorer 11支持
- 6. Internet Explorer 8不支持我的設計
- 7. 爲什麼Internet Explorer 11對象不支持屬性或方法'findIndex'
- 8. 爲什麼Internet Explorer不顯示foreignObject?
- 9. Internet Explorer支持的內容類型
- 10. Firebreath 1.6支持Internet Explorer 10嗎?
- 11. 門檻停止支持Internet Explorer的
- 12. 爲什麼在Internet Explorer 8中泄漏?
- 13. 爲第n個孩子選擇Internet Explorer的支持
- 14. 爲什麼Wordpress不能爲Internet Explorer 9分配<html id =「ei9」...?
- 15. Internet Explorer 7/8支持正常事件傳遞,不需要window.event?
- 16. Internet Explorer innerHTML「對象不支持此屬性或方法」
- 17. jQuery「對象不支持此屬性或方法」在Internet Explorer中
- 18. 「對象不支持此屬性或方法」在Internet Explorer中
- 19. 爲什麼jQuery tableFilter插件在Internet Explorer中不起作用?
- 20. 爲什麼我的網頁不能在Internet Explorer 8中滾動?
- 21. 爲什麼我的JavaScript函數在Internet Explorer中不起作用
- 22. 爲什麼我的網站不能在Internet Explorer中加載?
- 23. 爲什麼Internet Explorer 8打印不可見的內容?
- 24. 圖像不能在Internet Explorer中加載。爲什麼?
- 25. 爲什麼Internet Explorer不解析我的CSS?
- 26. Internet Explorer菜單z-order:爲什麼不是正確的?
- 27. 爲什麼Internet Explorer不允許更改輸入的類型?
- 28. 任何想法爲什麼Internet Explorer不保存會話cookie?
- 29. 爲什麼Internet Explorer 11不能解碼這個javascript?
- 30. 爲什麼使用Internet Explorer進行gzip壓縮不起作用?
'Array.prototype.includes'實際上是由ES7引入的。 –