internet explorer 8 - Javascript - "type"在IE8中返回nu
internet explorer 8 - Javascript -- "type" returns null in IE8
IE8(不是Firefox或Chrome)对以下功能有一个抱怨:
function getCachedSortType(parsers, i) {
return (parsers) ? parsers[i].type : '';
}
这是这样拉出来的:
for (i = 0; i < l; i++) {
c = sortList[i][0];
order = sortList[i][1];
// fallback to natural sort since it is more robust
s = /n/i.test(getCachedSortType(tc.parsers, c)) ? "Numeric" : "Text";
错误:"'type' is null or not a object"
使用此排序器填充表的每个单元格。如有任何建议,不胜感激。
这意味着您的parsers
对象不包括您的getCachedSortType
期望的项目(或getCachedSortType
期望错误的东西!)
你可能想要添加一些额外的防弹:
function getCachedSortType(parsers, i) {
if (parsers && parsers[i] && parsers[i].type) {
return parsers[i].type;
} else {
console.log(parsers);
throw new Error('Bad parsers format!');
}
}
相关文章:
- Recaptcha在IE7和IE8中不起作用
- 铬:“;未捕获的语法错误:意外的标记:"
- 可以设置“;文件名"发生错误时显示的内联脚本标记的
- JS表单提交"无法使用Chrome数据保护程序加载此页面.尝试重新加载页面.调试信息:POST CISmtuK
- 检测电话窃听,即:<a href="电话:xxx">在UIWebview上
- 使用“+="操作人员
- Joomla Gantry Framework ie8 LESS/CSS
- //而不是在src=“”上使用http://"属性
- "未捕获的语法错误:意外的标记}"
- 可以<脚本类型=“;text/javascript”>window.location=“/"</
- 为什么jQuery 1.8不能在IE8和InternetExplorer9中使用?(截至2012年9月的IE9最新版本)
- "实例范围”;TypeScript类的getter/setter
- Javascript复选框函数:;缺少:在属性id之后"
- jquery validate 1.8.1”;jQuery"是未定义的错误IE8
- Photoswipe 4:如何正确地禁用“;getThumbBoundsFn"在支持IE8的纯VanillaJ
- "停止运行脚本错误“;在IE8中拥有大量收藏
- "indexOf“;作为“”中数组的键;对于在“;cicle在IE8中
- "类型错误:对象没有´t支持这个未定义的动作“;Angular应用程序IE8中的错误
- "预期对象“;仅在IE8中使用jQuery时出错
- jQuery AJAX和IE8输出“;无效的参数"