I have search results that I want to break in part. I set 10 results in a .each () loop and Then break the loop in result number 10. If the user clicks on a certain, then the results should be displayed until the 20 results appear. The loop closes correctly, but it does not continue (i.e., show more results), when the button is pressed. To display search results, each (task) {// code} if (index% 10 === 0)) {// loop return false stop; $ ("Button # more results"). Click (function (event) {// continue the loop of each function return;});}}); // End of each function
You have never added your handler to your click ( )
call after is back
, so it has never been executed. Try:
if (index% 10 === 0) {$ ("button # more results"). Click (function (event) {// // continue the loop of each function return;}); // loop return false stop; }
No comments:
Post a Comment