Trim is not supported on IE8, use regexp instead of it.