[TYPO3-dev] Positioning JavaScript from a FE plugin
Steffen Kamper
steffen at sk-typo3.de
Sat Nov 24 17:05:12 CET 2007
"Martin Kutschker" <martin.kutschker-n0spam at no5pam-blackbox.net> schrieb im
Newsbeitrag
news:mailman.1.1195919180.31057.typo3-dev at lists.netfielders.de...
> Francois Suter schrieb:
>> Hi all,
>>
>> In a FE plugin I need to position JavaScript at precise places in the
>> HTML code, i.e. right after the opening body tag and right before the
>> closing body tag.
>>
>> Right now I'm simply relying on the PAGE object using
>>
>> page.1 = USER
>> page.1 ...
>
> You could also use the body-tag object (see TSref) for that. But this is
> something for the site admin to do.
>
>> This is all fine as long as it's just me using this extension in my
>> sites, but it's bit of a hassle otherwise.
>
> Adding TS code like that isn't any good anyway. How can you know that my
> PAGE object is called "page"?
>
>> Is there any way to place that JavaScript from within the plugin's class
>> precisely at the right points?
>
> No. And it wouldn't be any good as there could be two extension which
> think "right after <body> is the only place for my code".
>
> Masi
I agree that there has to be a handler in pagegenscript to add JS at the end
of the page as it is suggested by Yahoo performance rules.
vg Steffen
More information about the TYPO3-dev
mailing list