use jQuery trim() for ie8 compatibility