var n = $('div').size(); // не работает сайз. alert(n); // алерт вообще не выполняется. 

Using the same get instead of the size:

 var n = $('div').get(0); // всё работает возвращает первый элемент. alert(n); // работает 
  • Any errors? What kind? And where does .get(0) return the house object? - Alexey Shimansky
  • Uncaught TypeError: $ (...). Size is not a function jq.js: 3793 - Vanya
  • strange, it works for me. as an alternative to n.length :) maybe you have jquery> = 1.8. size outdated - noadev
  • cited get (0) so that there is no doubt about whether I have div elements at all - Vanya
  • @ Vanya size outdated from version 1.8 ... use .length ... see the version of your jigging ....... - Alexey Shimansky

0