Javascript Trim Function IE7 and IE8

trim() does not work with ie7 and ie8.

If you need to use trim(), you must be caregful because trim() does not work with ie7 and ie8.

You can define trim() by yourself easily
[js]
if(typeof String.prototype.trim !== ‘function’) {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, ”);
}
}
[/js]