Please tell me why this cycle runs infinitely? If you put console.log ("123") in front of $ .get, this is displayed infinitely and eventually the browser hangs, if not all windows. Nevertheless, $ .get is not executed at all.
addresa = pictures.split(":") count = addresa.length; nowfile = 0; openw = 4 while(nowfile < count) { $.get("http://192.168.1.108/photos/" + addresa[nowfile], function(data) { console.log(data) str = "data:image/jpg;base64," + data docInfo['content'][openw] = { image: str }; console.log("ban") openw = openw + 1; nowfile = nowfile + 1; ban = ban + 1; pdfMake.createPdf(docInfo).download(addres + '.pdf'); }); };