This is my code:
$.each(3, function(n) { alert(n); });
I want to alert three times but it doesn\'t work. What can I do?
each must operate on an object. Try to create an array of length 3, e.g.
each
$.each(new Array(3), function(n){alert(n);} );
Of course, I don't see the reason to avoid normal Javascript.
for (var n = 0; n < 3; ++ n) alert(n);