gpt4 book ai didi

javascript - Angular Js - TypeError : Object doesn't support property or method "includes"

转载 作者:行者123 更新时间:2023-11-29 15:24:10 24 4
gpt4 key购买 nike

我在我的应用程序中使用了 angular js。当我在 IE 浏览器上运行我的应用程序时,它显示以下错误。

 TypeError: Object doesn't support property or method 'includes'
at request (https://xxx.xx.xxx.com/js/app.js:32:20185)
at u (https://xxx.xx.xxx.com/js/base.js:5:30028)
at Anonymous function (https://xxxx.xx.xxxx.com/js/base.js:5:30210)
at $eval (https://xxxx.xx.xxxx.com/js/base.js:6:5594)
at $digest (https://xxxx.xx.xxxx.com/js/base.js:6:4028)
at $apply (https://xxxx.xx.xxxx.com/js/base.js:6:5883)
at Anonymous function (https://xxxx.xx.xxxx.com/js/base.js:4:7566)
at i (https://xxxx.xx.xxxx.com/js/base.js:4:19305)
at s (https://xxxx.xx.xxxx.com/js/base.js:4:7480)
at ae (https://xxxx.xx.xxxx.com/js/base.js:4:7676)

我该如何解决这个问题?

谢谢

最佳答案

includes() 在 Internet Explorer 上不受支持。最简单的替代方法是使用 indexOf,如下所示:

if(your_string.indexOf("?") >= 0) {
//statements
}

关于javascript - Angular Js - TypeError : Object doesn't support property or method "includes",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41158633/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com