I've found that loading the same javascript file twice or more (via PHP) can cause errors in IE (such as: line 1 char 1 code 0
). 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 $scripts_for_layout variable
? 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 'once'[true|false]