.getScript() equivalent in MooTools?

最后都变了- 提交于 2019-12-13 14:14:20

问题


I was wondering if there is a MooTools equivalent to jQuery's .getScript()? I'm pretty certain that this exists somewhere in MooTools but I haven't been able to find it yet.


回答1:


I'm not that familiar with MooTools, but it looks like you can use Asset.javascript.

var myScript = Asset.javascript('/scripts/myScript.js', {
    id: 'myScript',
    onLoad: function(){
        alert('myScript.js is loaded!');
    }
});


来源:https://stackoverflow.com/questions/6065725/getscript-equivalent-in-mootools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!