I would like to run a javascript function after loading results from an Ajax Search using the JA K2 Filter module. Is there a javascript event or similar hook that I could add my custom JS to? If possible, I would like to extend the component instead of overwrite it.
Example javascript (desired):
function doSomething() {
console.log("hi. I'm doing something");
}
jQuery('#k2Container').bind('afterJak2Filter', doSomething);
This is currently possible by extending jQuery’s html function, but that seems like a bad idea if avoidable.
If you’re interested in knowing how to do this:
var originalHtmlFunction = jQuery.fn.html;
jQuery.fn.html = function(){
var ret = originalHtmlFunction.apply(this, arguments);
doSomething();
return ret;
}