Thursday, September 15, 2011

PATCH .trim() in JavaScript not working in IE


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

No comments: