/*** 删除左右两端的空格*/String.prototype.trim=function(){return this.replace(/(^s*)|(s*$)/g, '');}
调用方式:
var searchValue=$("#searchValue").val(); if(null != searchValue && '' != searchValue){ searchValue = searchValue.trim(); }