2017-02-21 37 views
1

如何使用HAndsOnTable和Angular 1.4.8使用IE11來獲得此JSFiddle?我得到這個錯誤:Angular 1.4.8與IE11不兼容 - 對象不支持屬性或方法'endsWith'

Object doesn't support property or method 'endsWith'

我不知道,但我認爲罪魁禍首是這一行:

$scope.$apply(); 
+0

它不是在所有undepending在其瀏覽器中使用的工作。請修正你的JavaScript錯誤。 – lin

+0

它工作在最新的鉻。我想知道爲什麼它在IE中不起作用。 –

+1

沒有你的小提琴沒有工作。它充滿了錯誤。例如'錯誤:[ng:areq]參數'TodoCtrl'不是函數,得到了undefined'。或'混合內容:'https://jsfiddle.net/r0pk793e/12/'頁面通過HTTPS加載,但請求一個不安全的樣式表'http://twitter.github.io/bootstrap/assets/css/bootstrap的CSS。此請求已被阻止;內容必須通過HTTPS提供。「# – lin

回答

1

我定你fiddle我也固定了IE11錯誤。請注意,.endWith()在IE中不是一個有效的函數。一旦你添加了這個功能爲原型,你將被罰款:

if (!String.prototype.endsWith) { 
    String.prototype.endsWith = function(searchString, position) { 
     var subjectString = this.toString(); 
     if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { 
     position = subjectString.length; 
     } 
     position -= searchString.length; 
     var lastIndex = subjectString.indexOf(searchString, position); 
     return lastIndex !== -1 && lastIndex === position; 
    }; 
} 

(從https://www.sitepoint.com/community/t/endswith-issue-in-ie11/233838拍攝)

+0

謝謝!有什麼奇怪的是,當我添加你的prototype.endsWith到我的小提琴它工作得很好,但在你的...當我改變表中的值頁腳不會更新。 –

+0

請看這裏:https://jsfiddle.net/r0pk793e/18/ –

+0

我會檢查這個。支持 – lin

相關問題