javascript - LABjs : How to append the scripts to the end of the body tag

标签 javascript jquery labjs

我使用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/

相关文章:

javascript - dyld : lazy symbol binding failed, opencv

javascript - 如何通过q​​uerySelector改变同一个类的多个div

javascript - 无法通过 JavaScript 调用淡入淡出 div

javascript - 异步加载js文件和其他依赖的js文件

javascript - LABjs问题,无法加载脚本

javascript - 每次迭代后更新数组

javascript - 访问数组中的对象,它是另一个对象的属性 - Javascript

javascript - 尝试使用 AJAX 将 JavaScript 变量传递给 PHP,但得到 'Undefined index'

javascript - 仅更改父项的不透明度

javascript - Uncaught Error : [$injector:modulerr] Failed to instantiate module with LABJS