SCRIPT438:对象不支持属性或方法'filter'IE10

时间:2014-02-13 21:01:47

标签: javascript arrays html5 filter dynamics-crm-2011

我从Web服务加载一些数据并尝试过滤它。

var topLevelProductTypes = [];

topLevelProductTypes = productTypesArray.filter(function (pt) {
     return (pt.NS_designcentreproducttypeid.Id === null);
});

我收到错误SCRIPT438:对象不支持属性或方法'filter'

1 个答案:

答案 0 :(得分:2)

在标题<meta http-equiv="X-UA-Compatible" content="IE=edge" />

中添加此内容

productTypesArray在您的代码中看起来未声明。我认为它已分配给array

if( Object.prototype.toString.call( productTypesArray) === '[object Array]' ) {
    alert( 'It is an array' );
}