Est*_*ban 1 javascript jquery jquery-chosen
将Web应用程序部署到远程主机后,我收到了这个奇怪的错误.
Uncaught TypeError: Object #<error> has no method 'endsWith'
事实:
加载的文件是:

文件编写如下:

方法是这些:
String.prototype.startsWith = function (toMatch) {
var self = this;
return self.indexOf(toMatch) == 0;
};
String.prototype.endsWith = function (toMatch) {
var self = this;
return self.toLowerCase().indexOf(toMatch.toLowerCase(),
self.length - toMatch.length) !== -1;
};
String.prototype.contains = function (toMatch) {
var self = this;
return self.indexOf(toMatch) !== -1;
};
Run Code Online (Sandbox Code Playgroud)
我不是使用javascript的高手但是当我访问原型对象时,intellisense向我显示了这个:

此异常有两个可能的原因:
delete(不太可能)Object #<error>不是String实例.看起来如果那是问题:-)| 归档时间: |
|
| 查看次数: |
3499 次 |
| 最近记录: |