Replaced $.trim with jQuery.trim