Trivial bugfix for IE8

You have a call to .trim() which doesn't work in older browsers (e.g. IE8). Replacing it with $.trim() restores IE8 compatibility.