You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to connect the JS library as a module in Grails application. For this, I use the following format in the GSP: <asset:javascript src="myLibrary.js" type="module"/>
The "type" attribute is the usual one for the "script" tag. W3 specification
The "type" attribute with the value "text/javascript" is hard-coded into the string.
It is necessary to add a check for the presence of the attribute "type" in the "attrs" list: if (!attrs.containsKey('type'))
And only in this case add "type="text/javascript"" to the generated string.
I am trying to connect the JS library as a module in Grails application. For this, I use the following format in the GSP:
<asset:javascript src="myLibrary.js" type="module"/>
The "type" attribute is the usual one for the "script" tag. W3 specification
The error is on the following line:
asset-pipeline/asset-pipeline-grails/grails-app/taglib/asset/pipeline/grails/AssetsTagLib.groovy
Line 33 in 45f2f33
The "type" attribute with the value "text/javascript" is hard-coded into the string.
It is necessary to add a check for the presence of the attribute "type" in the "attrs" list:
if (!attrs.containsKey('type'))
And only in this case add "type="text/javascript"" to the generated string.
Example result code:
outPw << '<script ' << (!attrs.containsKey('type') ? 'type="text/javascript"' : '') << ' src="' << assetPath(src: src, useManifest: useManifest) << queryString << '" ' << paramsToHtmlAttr(outputAttrs) << '></script>' << endOfLine
The text was updated successfully, but these errors were encountered: