2016-12-15 42 views
3

我在我的應用程序中使用角度js。當我在IE瀏覽器上運行我的應用程序時,它顯示以下錯誤。Angular Js - TypeError:對象不支持屬性或方法「包含」

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) 

我該如何解決這個問題?

謝謝

回答

1

包括()在Internet Explorer上不受支持。最簡單的選擇是使用indexOf,像這樣:

if(your_string.indexOf("?") >= 0) { 
    //statements 
} 
相關問題