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
if you want you can add jquery and use $.trim(....) this will work..
$.trim(" hello ");
give you
"hello"