[TYPO3] Noobie - Javascript Including, Setup Screens

Peter Klein peter at umloud.dk
Wed Jun 20 11:01:41 CEST 2007


Hi Sancar. You just have to change the value to include the script tag.

$GLOBALS['TSFE']->additionalHeaderData[$this->extKey] = '<script 
type="text/javascript" 
src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/scripts.js"></script>';

this will include a file called "scripts.js" which is located in a folder 
named "res" inside your extensions folder.

-- 
Peter Klein/Umloud Untd

"Sancar Saran" <sancar.saran at evodot.com> skrev i en meddelelse 
news:mailman.337713.1182259625.21067.typo3-english at lists.netfielders.de...
> On Tuesday 19 June 2007 15:48:12 Rens Admiraal wrote:
>> Hi Sancar,
> Hi Rens
>> I'm relatively new to Typo also, but I can give you an answer for
>> your second question :-)
>>
>> You can add javascript code to the header using the $GLOBALS['TSFE']-
>>
>>  >additinalHeaderData array:
>>
>> $GLOBALS['TSFE']->additionalHeaderData[] = file_get_contents
>> (t3lib_extMgm::extPath($this->extKey, 'pi1/script.js'));
>>
>> (this reads the content from the file pi1/script.js in the frontend
>> extension dir, and puts it in the header. Don't forget to add the
>> <script> tags in this js file
>>
>>
>> Greetz,
>> Rens
>>
>
> I add this into script.
> $GLOBALS['TSFE']->additionalHeaderData[] = file_get_contents
> (t3lib_extMgm::extPath($this->extKey, 'evoBase.js'));
> $GLOBALS['TSFE']->additionalHeaderData[] = file_get_contents
> (t3lib_extMgm::extPath($this->extKey, 'cal2.js'));
>
> And system includes js files int head.
>
> Probably I made mistake when I was try to describe problem.
>
> I want to give refeence this javascript files in page <head></head> like 
> this
>
> <head>
> <title>Yabadaba dooo</title>
> <the other meta tag mumbo jumbo />
> <script type="text/javascript"
> src="whateverDirecotoryname/evoBase.js"></script>
> <script type="text/javascript" 
> src="whateverDirecotoryname/cal2.js"></script>
> </head>
>
> What is my mistake.
>
> Lots of thanks
>
> Sancar 




More information about the TYPO3-english mailing list