Fix String.trim() for IE

IE does not provide trim() method for String, use $.trim from jQuery instead.