Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The SWFObject API is awesome, use it instead:
drupal_add_js('http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js');
The above will not work if you have preprocessing on. Thank you.
....... On a side note, external JavaScript is in Drupal 7. For caching that, see #219346: Cache External Javascript.
Comments
Comment #1
Robert Castelo CreditAttribution: Robert Castelo commentedI haven't used SWFObject API, but based on it's README.txt these are the advantages of SWFObject Filter:
I'll be happy to work with SWFObject API developers to merge the two projects if that seems like a good idea.
Comment #2
RobLoachWhat I mean to say is that you could have the filter use SWFObject API to add things to the page. Something like this maybe?
<swf src="http://example.com/object.swf" width="600" height="400">
It would read that values, and then call
theme('swfobject_api')
with the appropriate output.Either way, this has been added to the similar module review group here.
This is not a fixed issue because if you turn on JavaScript preprocessing, the call to
drupal_add_js()
will not work. You'll either have to switch to SWFObject API, or use something like this:Thanks.