Download & Extend

Including remote .js files to scripts[] array doesn't work

Project:Zen
Version:6.x-1.0
Component:PHP Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

In my Zen subtheme .info file, adding

scripts[] = test.js

works; however, adding

scripts[] = http://mysite.com/scripts/header.js

doesn't -- the entry for the remote script is not showing up when I view source. Is there a way to include a remote .js file, or do I need to copy it to my local theme directory? We have a number of websites and want to keep this .js in one place, if possible.

I have cleared cached data to see if that made a difference.

Comments

#1

Same problem here, and clearing cached data didn't help.

#2

Category:bug report» support request
Status:active» fixed

:-(

Unfortunately, Drupal doesn't allow us to add external javascripts in this way. I think that's been fixed in Drupal 7.

The work-around is to follow the comment on http://api.drupal.org/api/function/drupal_add_js/6 and use drupal_set_html_head().

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.