<script> let numscr = 5; function loadScript () { $.getScript("https://cdn.jsdelivr.net/npm/masonry-layout@4.2.2/dist/masonry.pkgd.min.js"); if (--numscr) setTymeout(loadScript, 3000); } loadScript(); </script>