DocumentationOnline documentation for Ajax Load More
almComplete()
The almComplete() callback is public JavaScript function dispatched after every successful Ajax Load More query. The callback can be used to trigger functions in other JavaScript files, manipulate DOM content or simply console.log a message for debugging – how you utilize the callback is completely up to you.
Usage Examples
The following callback examples are used to initiate 3rd party scripts after successful ajax requests.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
// Easy Table of Contents - (https://wordpress.org/plugins/easy-table-of-contents/) window.almComplete = function(alm){ if(ezTOC){ ezTOC.init(); } } // LuckyWP - Table of Contents (https://wordpress.org/plugins/luckywp-table-of-contents/) window.almComplete = function(alm){ if(window.lwptoc){ window.lwptoc.globalInit(); } } // Contact Form 7 (https://en-ca.wordpress.org/plugins/contact-form-7/) window.almComplete = function(alm){ if(wpcf7){ wpcf7.initForm( $('.wpcf7-form')); } }; // Easy Fancybox (https://wordpress.org/plugins/easy-fancybox/) window.almComplete = function(alm){ $(document.body).trigger('post-load'); }; // Add to Any (https://wordpress.org/plugins/add-to-any/) window.almComplete = function(alm){ if(window.a2a_config){ a2a.init_all("page"); // Trigger AddToAny } } // Addthis (https://wordpress.org/plugins/addthis/) window.almComplete = function(alm){ if(typeof addthis !== 'undefined') { addthis.layers.refresh(); } } // ShareThis (https://www.sharethis.com/) window.almComplete = function(alm){ if (window.stButtons){ stButtons.locateElements(); } }; // Facebook Comments, Like Button, Share etc. window.almComplete = function(alm){ FB.XFBML.parse(); }; // Jetpack - Tiled Galleries window.almComplete = function(alm){ var base_url = 'http://mywebsite.com'; $.getScript( base_url + "/wp-content/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.js" ); }); |
Do you have an example you think others would find useful?
Submit it using our contact form and you will receive full credit and a link to your website.