you know whats crazy, this valid syntax... <cf...
# cfml-general
g
you know whats crazy, this valid syntax... <cftransaction isolation="read_committed"> ... <cftransaction action="commit"> ... </cftransaction>
m
Sorry I misread your post. Your example IS the proper way to do that.
It isn't "required" as backward compatibility, but if you're still using tags, yes, please close the tag that way.
And if you're wondering, HTML does this also. For example: <input type="blah" name="blahname" value="iliketurtles"> is "valid" (it'll work in the browser!) but really should be: <input type="blah" name="blahname" value="iliketurtles" />
(all this ends up not mattering in cfscript of course 🙂 )
c
Wasn't there something with the old "XHTML" doctype standard that required those closing slashes on tags that had no inner content?
m
Its a deep well. XHTML required closing slashed, and when HTML5 came out, it was put in as "optional". However, if you're using something like JSX, they are NOT optional.
Personally I close them for readability in my HTML5 code, and just in case I some day go completely mad and convert all of my code to a React front end lol 😄