I use colorbox node, which loads a node inside colorbox overlay. Inside colorbox I load a jquery script to add some parameters to all links inside. However, the loading is done by 2 ajax calls and I end up with doubled parameters on all links. I tried to use .once() but that does not return anything, probably because it fires after first ajax call. How to wait until second ajax call? Thank you.
my script:
(function($){ // Create local scope. Drupal.behaviors.jjj = { attach: function (context, settings) { $('#colorbox #block-book-navigation a', context).once('jjj', function () { $("#colorbox #block-book-navigation a").each(function(){ $(this).addClass("xxx"); console.log( "test" ); }); }); }}; })(jQuery);