I ‘may’ not have the right end of the stick with what you are looking to do but this:
`wp_enqueue_script( ‘dtheme-ajax-js’, get_template_directory_uri() . ‘/_inc/global.js’, array( ‘jquery’ ), bp_get_version() );
`
You can hook into that ‘array’ if you want to.
https://codex.wordpress.org/Function_Reference/wp_enqueue_script
$deps
(array) (optional) Array of handles of any script that this script depends on (scripts that must be loaded before this script). false if there are no dependencies. This parameter is only required when WordPress does not already know about this script.
Default: array()
@FIQ – assume you are meaning a jQuery event, equivalent to something like a document.ready() that fires on Ajax load. Pretty sure there are some default jQuery events ready to AJAX activity.. can’t remember names off top of my head
[EDIT: take a look at the global jQuery ajaxSuccess, ajaxError, ajaxStart, ajaxSend, and ajaxStop events — there are also local versions]
I’m completely ignorant about ajax and only slightly better with js. Most things I can figure out by trial and error, but not with ajax.
Two of the problems I’m have is with Fitvids.js (responsive video embeds) and prettyPhoto.js (lightbox).