Not a bug Bug with xf:js defer

kylerc

Well-known member
Affected version
2.0.0 RC1
Hey, I think I might have found an issue with xf:js.
Code:
<xf:js src="themehouse/dev/defer.js" defer="defer" />
works fine, but
Code:
<xf:js src="themehouse/dev/defer.js" defer />
causes all xf:js in that template not to be included in the page's source. I believe https://www.w3.org/TR/html5/syntax.html#attributes-0 should allow for the attribute to be used without a value specified though, assuming the intent with xf:js is to pass through attributes.
 
There are 2 issues here.

1. For the issue as reported, this is expected. XF template syntax (for both XF1 and XF2) XML-style attributes (compared to the SGML/HTML type shown). All attributes consist of name-value pairs.

2. <xf:js> is not designed to take arbitrary attributes and does not have a direct mapping with a <script>. You'll see that the defer part doesn't doesn't get passed through to the underlying tag. If you have to have arbitrary script attributes, then you need to insert the script tag directly as needed.
 
Back
Top Bottom