[TYPO3] Troubles getting Javascript validated between <head> tags

Christopher Torgalson bedlamhotel at gmail.com
Sat Feb 3 09:06:02 CET 2007


Hi,

On 2/2/07, Kimmo Helle <kimmo.helle at paitsio.com> wrote:
> Hi Ries,
>
> I added it to the html template and mapped it with templavoila. It shows
> still ok in templavoila when I select headers.


When you need js in the head of the document, don't use TV's 'Select
Header Items.' Instead use TS like this:

page.headerData.5 = HTML
page.headerData.5.value (
/* javascript code here */
)

However, I doubt that the actual js code needs to be in the head in
the first place--something like this:

page.headerData.5 = HTML
page.headerData.5.value (
<script type="text/javascript" src="fileadmin/scripts/foo.js"></script>
)
page.headerData.5.value.wrap = <!--[if IE]>||<![endif]-->

...will probably work just as well without bloating the page with
unnecessary code.


-- 
Christopher Torgalson


More information about the TYPO3-english mailing list