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

partha_pratim_p

04-03-2019

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 ?

Accepted Solutions (1)

Accepted Solutions (1)

PuzanovsP

MVP

04-03-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

Answers (0)