UNPKG

lively.ast

Version:

Parsing JS code into ASTs and tools to query and transform these trees.

9 lines (8 loc) 354 B
function loadUncached(urls, thenDo) { if (!urls.length) { thenDo && thenDo(); return; } var url = urls.shift(); var script = document.createElement('script'); script.src = url + (url.indexOf('?') > -1 ? '&' : '?' + Date.now()); document.head.appendChild(script); script.addEventListener('load', function() { loadUncached(urls, thenDo); }); }