I'm trying to convert some static HTML containing some JavaScript into a Drupal theme in D5.
Initially (even though this isn't the Drupal way), I just included the JS declaration in the page.tpl and it appeared to work. However, I then realised that, although the code was showing the page source, it was only "firing" when the page was "refreshed" via the Browser, according to Firebug.
I started reading and found out about drupal_add_js which I am now calling. Thing is, I now get nothing at all - even on a refresh.
Could someone please explain:-
A: why, if the code shows in the source, it doesn't fire?
B: point me to a good explanation of how Drupal 5 handles JavaScript
C: what might be wrong with the following code
define('UAT_WEBSTATS_SETUP' , 'sites/all/modules/custom/webstats/wa_setup.js');
$webstats_setup = UAT_WEBSTATS_SETUP;
drupal_add_js($webstats_setup,'inline');
Thanks in advance for any pointers
Terry