lazy-exec
v1.0.1
Published
To wait for the execution until the specified DOM appears.
Downloads
1
Readme
To wait for the execution until the specified DOM appears.
INSTALL
npm && browserify
npm install lazy-exec
var lazyExec = require("lazy-exec");
html script
download hrere.
<script src="path/to/lazyexec.standalone.js"></script>
USAGE
lazyExec("script[src^='https://code.jquery.com/']", function(error, element) {
// element is HTMLScriptElement
assert.strictEqual(element.src, "https://code.jquery.com/jquery.js");
});
var jquery = document.createElement("script");
jquery.src = "https://code.jquery.com/jquery.js";
document.head.appendChild(jquery);