var fileType = $.trim(n.resourcesMapping.extension).toLowerCase(); if($.inArray(fileType,fileTypeList)=='-1'){//其他 row.find(".fileType").addClass('other'); }else{ row.find(".fileType").addClass(fileType); }
ie8真是各种吐槽无能
1.不识别object.trim();方法
解决方法:$.trim(object);
2.ie9以下没有indexOf()这个方法
IE<9 doesn't have an .indexOf() function for Array,
解决方案:如果使用jquery的话,可以使用$.inArray()方法
jQuery.inArray( value, array [, fromIndex ] )Returns: Number
Search for a specified value within an array and return its index (or -1 if not found).
在数组中搜索匹配特殊字符,返回为该字符所在数组中的索引值
jQuery.inArray( value, array [, fromIndex ] ) value Type: Anything The value to search for. array Type: Array An array through which to search. fromIndex Type: Number The index of the array at which to begin the search. The default is 0, which will search the whole array.
PS:注意
The $.inArray() method is similar to JavaScript's native .indexOf() method in that it returns -1 when it doesn't find a match. If the first element within the array matches value, $.inArray() returns 0.
Because JavaScript treats 0 as loosely equal to false (i.e. 0 == false, but 0 !== false), if we're checking for the presence ofvalue within array, we need to check if it's not equal to (or greater than) -1.
相关推荐
js-trim()方法IE无效的解决办法
蒙特卡洛模拟matlab源代码关于Mat-TRIM的故事 这个名为Mat-TRIM的MATLAB...仪器方法174:257-269],但考虑了平面离子源和圆柱状靶结构。 尽管此程序非常简单,但它以很高的精度捕获了离子辐射中的一些关键物理原理。
蒙特卡洛模拟matlab源代码-MATLAB-TRIM-3D
基于SVD-TRIM特征和LSSVM人脸识别方法.pdf
用jquery的trim()方法,$.trim(str)就可以了。
前端开源库-safe-trim安全修剪、修剪支柱并清除内容中的零宽度空间
trim()方法
右修剪与类似,但仅删除右侧的空白安装$ npm install trim-right用法import trimRight from 'trim-right' ;trimRight ( ' unicorn ' ) ;//=> ' unicorn'有关的 left-与String#trim()类似,但仅删除左侧的空白 -与...
javascript 的trim 函数在firefox 下面使用没有问题 [removed] var test1 = aa ; test1 = test1.toString(); test1 = test1.trim();...在头上加上这一句,上面的就可以在IE和FF下都可以运行了 <script lang
mp3剪辑...trim-raindy.rar
trim.0ABEE065-DDB9-4721-8D68-59E7F1FE58A1-20240301233234.wav
js代码-trim方法实现
this.m_clientName = m_temp.Substring(m_temp.IndexOf("\"")+1,m_temp.LastIndexOf("\"")-m_temp.IndexOf("\"")-1).Trim(); m_temp = contentArray[2]; this.m_filename = m_temp.Substring(m_temp...
git-trim是git fetch --prune所缺少的伴侣,它是替代您的git的正确,安全,快速的替代方法 使用说明 配置| FAQ指令截屏安装从发行版下载二进制文件,并将其放在PATH目录下。 如果您有货物,也可以使用cargo install ...
本文实例分析了javascript在IE下trim函数无法使用的解决方法,对于web前段设计有一定的借鉴价值。具体分析如下: 首先,javascript的trim函数在firefox下面使用没有问题: [removed] var test1 = " aa "; test1 =...
javascript中去空格,javascript中没有内置trim()方法,这里来自己写个方法
解决浏览器对trim()方法的支持问题。开发是解决浏览器的兼容问题,发现某些浏览器对trim()方法不支持引起了问题
npm-registry-readme-trim 修剪 npm 注册表文档对象上的readme字段。 这会将单个版本的自述文件拉到文档的顶层,并将其长度减少到最大 64kb。 原地改变文档,如果它做了任何事情,则返回true 。 用法 var trim =...
JAVA中String 有trim()方法去除字符串左右的空格,js中自定义trim方法,去除字符串左右的杂质,可以去除逗号、句号、空格等等特殊字符。