You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
453 B
17 lines
453 B
exports = function(src, cb) { |
|
var script = document.createElement('script'); |
|
script.src = src; |
|
script.onload = function() { |
|
var isNotLoaded = |
|
script.readyState && |
|
script.readyState != 'complete' && |
|
script.readyState != 'loaded'; |
|
cb && cb(!isNotLoaded); |
|
}; |
|
script.onerror = function() { |
|
cb(false); |
|
}; |
|
document.body.appendChild(script); |
|
}; |
|
|
|
module.exports = exports;
|
|
|