Whenever I use the trim() function on a string, it works fine with Chrome and Firefox but I get an error in IE8 saying :
trim()
Object doesn\'t
Since, I was using jQuery, with the help of @nemo and @karesh-a I came up with:
if(typeof String.prototype.trim !== 'function') { String.prototype.trim = function(){ return jQuery.trim( this ); } }