ajaxStart / activeElement problem in Chrome win/mac
I'm using the ajaxStart/Stop functions to add a basic throbber next to certain elements and I'm relying on the activeElement value to determine which element to place it next to. In Firefox this works properly but in Safari/Chrome the activeElement shows as the entire body, not the element that was clicked.
- $(document).ajaxStart(function(a){
if($(a.currentTarget.activeElement).hasClass('throb-sm')){
$(a.currentTarget.activeElement).after('<span class="loading"></span>');
}
...
});
I've also tried this.activeElement, but it's the same. How can I resolve this? I simply need to be able to reference the button that was clicked to activate the ajax call.