[TYPO3-dev] Preventing JavaScript from Being included twice

Gijs Epping [eFocus] gijs.epping at efocus.nl
Tue Dec 30 13:08:11 CET 2008


Frank Weindel schreef:
> Hi All,
> 
> Is there a way to include a javascript file in the <head> that checks to 
> make sure that same file isn't already in there?
> 
> I want to include the prototype.js file that typo3 comes with in my 
> plugin. I know that sometimes (but surely not all) Dmitry's ratings 
> plugin will be included on the same page through the tt_news plugin. 
> Ratings also includes prototype, but directly as an addition header, so 
> not really doing anything to check if its already included.
> 
> So I face some circumstances where the file will be included twice in 
> the <head> and I'm worried that could cause conflicts or make the page 
> take longer to load.
> 
> Thanks,
> Frank

Hello,

I had the same problem with my own plugin therefore i create a setup 
that can be change on installation

You can make setup confgurations in:
ext_conf_template.txt

With the line:
# cat=all//20; type=boolean; label= Autoloads mootools : Loads Mootools 
javascript on the page.
mootools = true

You can turn mootools on/off for that plugin.

Hope this helps

Greetings Gijs

-- 
E: gijs.epping at efocus.nl
W: http://www.efocus.nl/
W: http://www.gijs.com/

################
# eFocus is looking for Typo3/Php Developers
# http://www.werkenbijefocusgroep.nl/
################




More information about the TYPO3-dev mailing list