Can we customizing AEM cq:includeClientLib to generate script tag without type="text/javascript" | Community
Skip to main content
March 4, 2019
Solved

Can we customizing AEM cq:includeClientLib to generate script tag without type="text/javascript"

  • March 4, 2019
  • 1 reply
  • 1257 views

The W3C Markup Validation Service  recomandate not to use type="text/javascript"   for script tag. But in AEM when we do it using cq:includeClientLib it adds it by default, is there a way not to include this additional settings for a script tag generated from aem by cq:includeClientLib ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Peter_Puzanovs

Hi Partha,

Currently, com.adobe.granite.ui.clientlibs.impl.HtmlLibraryWriter writes "text/javascript" by default as it's been build in the era pre HTML5.

There are no config parameters to not add "text/javascript". It would be nice to have an option to not add the type when customer is generating HTML5 or latest html code. smacdonald2008​​ possible improvement to granite.ui.clientlibs?

@Partha, simply create a PostProcessing Filter to change the output and remove text/javascript from final html output.

Regards,

Peter

1 reply

Peter_Puzanovs
Community Advisor
Peter_PuzanovsCommunity AdvisorAccepted solution
Community Advisor
March 4, 2019

Hi Partha,

Currently, com.adobe.granite.ui.clientlibs.impl.HtmlLibraryWriter writes "text/javascript" by default as it's been build in the era pre HTML5.

There are no config parameters to not add "text/javascript". It would be nice to have an option to not add the type when customer is generating HTML5 or latest html code. smacdonald2008​​ possible improvement to granite.ui.clientlibs?

@Partha, simply create a PostProcessing Filter to change the output and remove text/javascript from final html output.

Regards,

Peter