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

webfaqtory’s picture

Title: Block loaded dynamically(ajax) » Block loaded dynamically(ajax). FIXED
Version: 5.x-1.x-dev » 5.x-1.3

Fixed 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)
});

Alex UA’s picture

Title: Block loaded dynamically(ajax). FIXED » Block loaded dynamically(ajax).
Status: Active » Fixed

In the future please mark as fixed rather than place it in the issue title.

Status: Fixed » Closed (fixed)

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