[TYPO3-dev] Preventing JavaScript from Being included twice

Frank Weindel fjw24 at drexel.edu
Thu Dec 18 17:19:21 CET 2008


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




More information about the TYPO3-dev mailing list