jQuery wrapper: use jQuery.trim() instead of String.prototype.trim()

Switched from String.prototype.trim() to jQuery.trim() for IE8 and below support. This fixes issue #268