LABjs:如何将脚本附加到body标签的末尾

3

我使用了queueScript来添加脚本。但它们被添加在<head>标签中。我想把它们添加到body标签的末尾。我该怎么做?

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>

请提供一些代码以及示例链接,这样我们就可以检查并帮助您。谢谢! - Alive to die - Anant
@Anant,我按照你说的添加了代码。 - Divya Barsode
1个回答

0

你能使用吗?

 document.head.appendChild('your scripts here')

然后像这样抓住你的头或其他什么:

 var head = document.getElementsByTagName("head")[0];

我不想将它附加到头部。出于性能考虑,需要将它们附加到body标签的末尾。不确定LABjs是否在加载HTML后在末尾加载脚本文件还是在开头加载。 - Divya Barsode

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接