Update methods.js

Change .trim() to $.trim() to make it works in IE8