I'm trying to AJAXify page loads using .load()/.get() methods and the main problem I'm currently stuck with is that the loaded content isn't being processed by the relevant javascript code.

I've tried upgrading to jQuery 1.7 and addind this scary workaround: https://stackoverflow.com/questions/11442723/how-to-convert-bind-pass-through-to-on-to-delegate-like-right-inside-jqu , but the problem is not in the bind() calls AFAIU.

Something with Drupal.behaviors?

The simplest way to reproduce the issue is to take a page's #content.innerHTML that is normally being processed by JS (/admin/structure/block) and replace the #content HTML with it. This way the resulting HTML is the same but [for me] it's not processed by JS functions.

1 Answer 1


Looks like Drupal.attachBehaviors(jQuery("#content")[0]); is working. Some issues still exist though. Like the absence of relevant behaviors when loading from different page.

Taken from https://drupal.stackexchange.com/a/3193/7177

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.