添加“延迟”消息。 AEM 6.1中的clientLib脚本标签具有属性 [英] Adding "defer" attribute to clientLib script tags in AEM 6.1

查看:78
本文介绍了添加“延迟”消息。 AEM 6.1中的clientLib脚本标签具有属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将defer属性添加到脚本标签?我们可以通过head.html中的clientLib标记调用来获取它们,但是AEM以及如何轻松将defer标记添加到脚本中的地方并不多。

How would I add the defer attribute to our script tags? We get them via the clientLib tag call in our head.html but there's not much out there for AEM and how to easily add the defer tag to our scripts.

<clientlib data-sly-call="${clientLib.all @ categories=['company-libraries']}" data-sly-unwrap/>

感谢您的帮助!谢谢

推荐答案

您可以使用Jens答案: https://github.com/nateyolles/aem-clientlib-async ,但是该版本与ACS Commons版本的clientlib配合不好。这就是我这样做的原因:< a href = https://github.com/ahmed-musallam/aem-clientlib-async rel = nofollow noreferrer> https://github.com/ahmed-musallam/aem-clientlib-async

You could use Jens answer: https://github.com/nateyolles/aem-clientlib-async but that one does not play nice with ACS commons versioned clientlib.which is why I made this: https://github.com/ahmed-musallam/aem-clientlib-async

这篇关于添加“延迟”消息。 AEM 6.1中的clientLib脚本标签具有属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆