anonīms Posted April 26, 2011 Report Share Posted April 26, 2011 $(function(){ $(".last_div").each( function() { alert(1); }); }); html kodā ir divi <div class="last_div"></div>. Kāpēc neizlec neviens alerts? .js kods atrodas pareizajā vietā un pārējie kodi aiz šīm rindām strādā. firebug kļūdu neuzrāda. Link to comment Share on other sites More sharing options...
0 briedis Posted April 26, 2011 Report Share Posted April 26, 2011 Nu debugo: alert("Atrasti:" + $(".last_div").length); Link to comment Share on other sites More sharing options...
0 anonīms Posted April 26, 2011 Author Report Share Posted April 26, 2011 njā, atrod 0, bet kāpēc tā, ja kodā viss ir? Link to comment Share on other sites More sharing options...
0 codez Posted April 26, 2011 Report Share Posted April 26, 2011 acīm redzot nav tev tādu DOM objektu. Šeit viss strādā: http://jsfiddle.net/fbzhP/ Link to comment Share on other sites More sharing options...
0 briedis Posted April 26, 2011 Report Share Posted April 26, 2011 njā, atrod 0, bet kāpēc tā, ja kodā viss ir? Vai tiešām ir? Ar firebug vari atrast tos elementus? Drukas kļūdas nav nosaukumos? Link to comment Share on other sites More sharing options...
0 anonīms Posted April 26, 2011 Author Report Share Posted April 26, 2011 doh, js kodā pārbaudi liku pirms tas elements vispār tika izveidots. Link to comment Share on other sites More sharing options...
Question
anonīms
html kodā ir divi <div class="last_div"></div>.
Kāpēc neizlec neviens alerts? .js kods atrodas pareizajā vietā un pārējie kodi aiz šīm rindām strādā. firebug kļūdu neuzrāda.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts