admin管理员组文章数量:1323354
I'm building a simple web application that needs to pile a LESS file into CSS file on the fly.
I want to call a few JavaScript functions after less.js plete the render of style.less file.
I found the following code in a thread, but nothing working for me:
<link rel="stylesheet/less" type="text/css" href="less/style.less">
<script type="text/javascript" src="js/less.min.js"></script>
<script>
less.hasFinished.then(
function() {
console.log('pleted');
}
);
</script>
Also tried few other things:
<link rel="stylesheet/less" type="text/css" href="less/style.less">
<script type="text/javascript" src="js/less.min.js"></script>
<script>
less = {
postProcessor: function(css) {
console.log('plete');
}
};
</script>
Is there any less.onComplete() callback function or something similar??
I'm building a simple web application that needs to pile a LESS file into CSS file on the fly.
I want to call a few JavaScript functions after less.js plete the render of style.less file.
I found the following code in a thread, but nothing working for me:
<link rel="stylesheet/less" type="text/css" href="less/style.less">
<script type="text/javascript" src="js/less.min.js"></script>
<script>
less.hasFinished.then(
function() {
console.log('pleted');
}
);
</script>
Also tried few other things:
<link rel="stylesheet/less" type="text/css" href="less/style.less">
<script type="text/javascript" src="js/less.min.js"></script>
<script>
less = {
postProcessor: function(css) {
console.log('plete');
}
};
</script>
Is there any less.onComplete() callback function or something similar??
Share Improve this question edited Jul 30, 2021 at 15:15 TylerH 21.1k77 gold badges79 silver badges112 bronze badges asked Dec 23, 2014 at 9:31 NehalNehal 1,0221 gold badge10 silver badges33 bronze badges1 Answer
Reset to default 14Try pageLoadFinished
<script>
less.pageLoadFinished.then(
function() {
console.log('pleted');
}
);
</script>
本文标签: javascriptWhat is the lessjs complete event callbackStack Overflow
版权声明:本文标题:javascript - What is the less.js complete event callback? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742129213a2422080.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论