jQuery function is not found by ajax.js
I am having trouble getting my jQuery function to be called by ajax.js
I have in my module the code call back code
Which works fine (I can bring in new images) expect for the last part here, it cannot find the function "initEventsAgain" which is "inlined" in the web page, defined as follows,
$.fn.initEventsAgain = function(){...}
})(jQuery);
Also, I tried not to enclose it into a jQuery namespace
That does not work either, the ajax.js code cannot find the function. Is the function being loaded too late?.
Now I am leaning towards "Drupal.Behaviors". It seems promising.
Hey there,
I know it's been a while since you asked, but if it's still a question, I'd like to know what the 'initEventsAgain' function should do. From it's name, it sounds like exactly what Drupal behaviors are meant to do, that is to run jQuery on new HTML on the page that needs behaviors attached to them.
Just in case, here's the video on using behaviors:
Cheers!
Chris