replace trim() with $.trim(... as ie8 does not know trim()