string.trim() doesnt work in IE8, change to jquery.trim()