Expand my Community achievements bar.

SOLVED

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

Avatar

Level 1

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 ?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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