插入带有script标签的html字符串并回调
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitattributes
.gitignore
README.md
core.js

README.md

runhtml

把带有script标签的字符串插入到dom,全部插入完成后(如果有引用外部js文件,会等到所有外部js文件加载完成)回调 ####demo:

function success() {
    console.log('success');
}
function error() {
    console.log('error');
}
var html = '<div>abc</div><script>var a = 12;</script><script http://code.jquery.com/jquery-2.1.1.js></script>';
runHtmlWithScript(document.body, html, success, error);