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.
I'm loading a Drupal block of videos dynamically via ajax (setting the block innerHtML from an ajax call). Where the videos should be I get 'Sorry, you need to install flash to see this content.'
If I give the the url to the block in the browser address bar, all is ok
swfobject.js in loaded for all pages.
Is there some setup javascript I should run before/after setting the block html?
Many thanks
John
Comments
Comment #1
webfaqtory CreditAttribution: webfaqtory commentedFixed the problem. If you are doing something like this, the problem is that the embedded javascript isn't run for content loaded dynamically via ajax. To get the js to run I added the code below immediately after loading the innerHTML of my block (requires jquery which is always loaded in a Drupal page)
$("div.field-type-video-cck script").each( function() {
eval(this.innerHTML)
});
Comment #2
Alex UA CreditAttribution: Alex UA commentedIn the future please mark as fixed rather than place it in the issue title.