2011年3月19日 星期六

[JavaScript] trim() function for IE

if(typeof String.prototype.trim !== 'function') {
   String.prototype.trim = function() {
          return this.replace(/^\s+|\s+$/g, ''); 
   }
}

"We don't well support any IE browsers as that is killing all of the web engineers' time." -- GuruDigger
Related Posts Plugin for WordPress, Blogger...