In my subtheme's info file I am adding two scripts

  ; Optionally add some jquery scripts to your theme.
 scripts[] = jquery-browser.js
 scripts[] = general.js

But if a person is anon, $scripts is an empty string.

Am I missing something here?

Comments

dstol’s picture

Also jquery.js and drupal.js aren't included.

valthebald’s picture

if $scripts is empty, try to add to phptemplate_preprocess_page(&$vars) the following lines:
drupal_add_js('var a=1', 'inline'); // meaningless js code, to initialize standard js inclusion
$vars['scripts'] = drupal_get_js('header');

RenMan4115’s picture

I'm having the same problem with my Zen subtheme.

If I don't include at least one script in my mytheme.info file, then anonymous users don't get any scripts on page loads (not even the default jquery.js and drupal.js).

As soon as I include one script in mytheme.info, then jquery.js and drupal.js load as well. Is this, then, the only way to make sure those defaults are loaded for the anonymous user?

valthebald’s picture

I guess so. After second thinking, I dare say this is not a bug. There's no reason to include default scripts if they are the only scripts on page :)

akalata’s picture

Status: Active » Closed (works as designed)