javascript - How to call this function 15 times by for loop? -


i want call function 15 times loop fire on button click please me.

$(function() {     $("#btnsave").click(function()     {         html2canvas($("$widget"),         {             onrendered: function(canvas)             {                 thecanvas = canvas;                 document.body.appendchild(canvas);                  //convert , download image                 canvas2image.saveaspng(canvas);                 $("#img-out").append(canvas);                 //clean                 //document.body.removechild(canvas)             }     });     }); }); 

i want call function 15 times loop fire on button click please me . please

you use simple loop repeat code, recommend being more explicit , using excellent lodash library if can:

https://lodash.com/docs#times

_.times(15, function() {     // function body run 15 times }); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -