Document Ready equivalent for downloadable ajax content via jQuery Mobile accordion

As the super-long title says, I need something like the equivalent of jQuery Document Ready, which will work with dynamically loaded content that loads through ajax in jQuery Mobile accordion / resettable.

We have a few things that DO NOT WORK:

  • It is not possible to add javascript to the actual markup (due to CMS), so it needs to be loaded via the global js file.
  • $(document).ready() will not work because it is not a technical document that we expect to download.
  • $('div#id').load()doesn't seem to work.
  • $('div#id').ready()seems to start anytime the actual page loads, regardless of whether the collapsible content is running.

This is a kind of shot in the dark, but all that you guys can help with, I am grateful for :).

thank

+5
source share
1 answer

Use . ajaxComplete ()

$(document).ajaxComplete(function(e, xhr, settings){

});

If you want to do something when there is something new in the document, add:

$(document).on('DOMNodeInserted', function(e) {

});
+19
source

All Articles