Avoiding multiple instances of the same JS file

BIG-D

New Member
I've found that loading the same javascript file twice or more (via PHP) can cause errors in IE (such as: \[code\]line 1 char 1 code 0\[/code\]). This occurs when a webpage is constructed from nested templates - in this case, CakePHP. Is there a way to include a file only once?Perhaps, in CakePHP, it can be done by manipulating the \[code\]$scripts_for_layout variable\[/code\]? For this to work, scripts would have to be loaded not-inline.Edit:I'm using 1.2 so the $html->script option is not available. Shame as one of the options is \[code\]'once'[true|false]\[/code\]
 
Back
Top