Advanced Ajax Page Loader (AAPL) blocks resources

In general AJAX requests return data, how the data is formatted and what do you do with it is up to you.

Things that are very hard to do in to add and remove JS and CSS. Adding full files is easier as all you need to to insert a script or link element to the dom if the correct, but fragments like are usually pushed on wp_head are harder. Removing JS is practically not possible, CSS maybe.

So what does it mean in practice? It means that when you write an AJAX based code, you better always enqueue all the relevant JS and CSS in all pages, and all the AJAX response will have to do is have proper CSS class and (if not covered in other way) inline calls to JS functions.

You can hardly expect that you can just use a full HTML page “as is” in an AJAX response and have it working, except for trivial pages.