Pulling trim out of the chain due to IE8 issues.

Using .trim() in the chain causes IE8 to throw an "Object doesn't support this property or method" error due to html() not returning a jQuery object. Wrapping it beforehand fixes this.