The other day I was using SWFObject to place a Flash movie on a page. After entering the code it looked good in all browsers. All except IE6.
Now for a short pause while we all act stunned and surprised.
When accessing the page, IE6 would refuse to display it and instead just display an error message. It all stemmed from how IE6 handles the base tag. There are fixes posted on the web which involve feeding IE6 a full base tag instead of the valid self-closing tag. All that is fine an dandy except it is not quite that easy to do in TYPO3.
Using the config.baseURL in TYPO3 to set the base tag always results in a valid self-closing tag. Now, it is possible to not set the base tag through config.baseURL and instead include it in headerData. The problem with that approach is the base tag will fall after some of the TYPO3 included assets (like the CSS file containing CSS for some of the extensions). Since those are relative links there will be a problem if the base tag falls after them.
As I thought about this I remembered one of my earlier posts about modifying the TYPO3 header comment and decided to try something. I wrote this TypoScript:
[browser= msie6]
config.headerComment (
This is to allow IE6 to see Flash
-->
<base www.mydomain.com/"></base >
<!--
)
[ELSE]
config.baseURL = www.mydomain.com
[GLOBAL]
So, what happens? All browsers but IE6 get a proper self-closing tag in the correct location (like this), but IE6 gets a full base tag that falls before any linked asset (like this).
In effect what I have done on IE6 is added a short note to the TYPO3 header comment then prematurely closed the comment, added the full base tag and then reopened the comment.