[TYPO3-core] FYI48 #10955: Output of additionalCSS not valid

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Feb 7 12:08:25 CET 2011


Georg Ringer schrieb am 07.02.2011 10:15:
> Am 07.02.2011 10:07, schrieb Ernesto Baschny [cron IT]:
>> Could you elaborate more on that, please? Why is it not valid? Aren't
>> those comment markers required for some "old browsers" to skip them and
>> not print them "in the page"?
> 
> can't we get rid of those in trunk or at least make an option and turn
> it of on default? I really don't like those comments and I don't know of
> any current browser which need that.

We could, if there is some more definitive proof about this fact other
than you "don't knowing of any current browser".

Here is some explanation:

http://javascript.about.com/library/blxhtml.htm

Recommending this setup:

<script type="text/javascript">
/* <![CDATA[ */
// content of your Javascript goes here
/* ]]> */
</script>

Another variant I've seen:

<script type="text/javascript">
// <![CDATA[
// content of your Javascript goes here
// ]]>
</script>

But the author also only mentions "some older web browsers" as the
reasons for the commenting out "CDATA". Basically a browser which
doesn't parse XML will bring a JS error if we only had "only" this:

<script type="text/javascript">
<![CDATA[
// content of your Javascript goes here
]]>
</script>

So while I am not a fan of "hacks", I also think that those extra 8
bytes of code won't hurt that much. So I am basically for keeping them
(especially in the frontend, where we don't know which browsers are
accessing the TYPO3 implementation).

In the backend, since we are "html5" now, maybe a totally new solution
is the "best practice", but I cannot find any information on that. Do
you have some links?

Cheers,
Ernesto



More information about the TYPO3-team-core mailing list