.size() deprecated since jquery 1.8

.size() replaced with .length