我使用queueScript来附加脚本。但它们被附加在 <head>
中标签。我想将它们附加在正文标记的末尾。我该怎么做?
var comp;
var _DIR_ = "js/vendor/";
var _BOWER_DIR_ = "bower_components/";
$LAB.setOptions({
AlwaysPreserveOrder: true
});
$LAB
.queueScript(_DIR_+'jquery2.1.3.min.js')
.queueScript(_DIR_ + 'angular.min.js')
.queueWait()
.queueScript(_BOWER_DIR_ + 'angular-bootstrap/ui-bootstrap-tpls.min.js')
.queueScript(_DIR_+'angular-animate.min.js')
.runQueue();
</script>
最佳答案
可以用吗?
document.head.appendChild('your scripts here')
像这样捕获你的头或者其他什么:
var head = document.getElementsByTagName("head")[0];
关于javascript - LABjs : How to append the scripts to the end of the body tag,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42367967/