javascript - Jquery loop coding -


i have problem jquery loop. not stopped after reach 10th element, display 10 times every element. don't know problem. must add counter (z) after if clause, because want display 10 elements of filtered items (i if must not filter elements).

the part of code:

 function(data) {        $.each(data.query.results.tbody, function (i, e) {  .. ... .... ......      if (x != '-') {         var z;         (z = 0; z < 10;) {             $(".news").append('xxxxx');             z++         }     }              });   }  ); 

var temp=''; (z = 0; z < 10; z++) {     temp += "xxxx"; } $(".news").append(temp); 

append var outside loop. creare var temp, append data , after loop completes, post append: https://learn.jquery.com/performance/append-outside-loop/


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -