1

I'm using flag module to flags my nodes. Now, in frontpage the list of nodes (html) is get and put in the main DIV via AJAX, so the flag module has not parsed these nodes. How can I say to flag module to re-get and process all flag link ? I know that I need to insert the call in my AJAX .get() function, but which is the correct flag-JS-function to call ?

Thanks.

1

You probably should run Drupal.attachBehaviors($('.newcontent')); instead of trying to add this logic manually for each module. But since you asked for flag 3.x it is Drupal.behaviors.flagLink.attach($('.newcontent'));

  • Andre-B: thanks. It works without $('.newcontent') too. – ZioBudda Mar 30 '15 at 20:06
  • yea, that will trigger the attachBehaviors again on all elements I guess.. – Andre Baumeier Mar 31 '15 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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