Live2D

动态追加js

判断是否已引用js,如果没有会引发异常,在异常时添加引用

 try {
        if (layui) {}
    }
    catch (ex) {
        var s = document.createElement('script');
        s.src = '/Content/Layui/layui.js';
        document.head.appendChild(s);
    }

 

posted @ 2018-11-01 10:36  webmtjj  阅读(239)  评论(0)    收藏  举报