cq5 - Adobe AEM: How to add "defer" attribute to script tag for scripts included through cq inlcude clientlib tag -
i'm including libraries through <cq:includeclientlib ../>
tag.
i wanted include defer value under script tag as:
<script defer scr="something.js"></script>
but once code included using include client lib tag:
<cq:includeclientlib categories="something.lib"/>
and see libraries being included normal css , js includes:
<link rel="stylesheet" src="something.css" type="text/css"> <script type="text/javascript" src="something.js"></script>
how defer attribute added js script include shown in initial code above? have tried searching on various forums , unable find answers. appreciated.
one way create custom requestrewriter. allows change written output html client lib script tag.
this commons package has code example request rewriter used, , similar rewrite attributes script tag:
also see following:
- http://www.cqblueprints.com/tipsandtricks/serving-static-assets-alt-url.html - references package has example
- https://sling.apache.org/documentation/bundles/output-rewriting-pipelines-org-apache-sling-rewriter.html
- http://www.wemblog.com/2011/08/how-to-remove-html-extension-from-url.html
- what missing cq5/aem url rewriting scenario?
- https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/rewriter/pipeline/requestrewriter.html
- https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/rewriter/pipeline/package-summary.html
Comments
Post a Comment