Fix jQuery #13251: use slice instead of substring