[size=large]jquery的遍历
集合.each(function(){});
-----------------------------------
实用工具函数---去除字符串开头和结尾的空格
$.trim(something) something--字符串 该函数返回去除了空格的字符串
部分源码:
var str = " lots of spaces before and after\n";
alert("'" + str + "'");
//返回的是' lots of spaces before and after' //带有空格
str = jQuery.trim(str);
alert("'" + str + "' - no longer");
//返回的是'lots of spaces before and after' //单引号后没有了空格
很实用的函数
-----------------------------------
[/size]
集合.each(function(){});
-----------------------------------
实用工具函数---去除字符串开头和结尾的空格
$.trim(something) something--字符串 该函数返回去除了空格的字符串
部分源码:
var str = " lots of spaces before and after\n";
alert("'" + str + "'");
//返回的是' lots of spaces before and after' //带有空格
str = jQuery.trim(str);
alert("'" + str + "' - no longer");
//返回的是'lots of spaces before and after' //单引号后没有了空格
很实用的函数
-----------------------------------
[/size]