Title: Add  in callback
Last modified: September 1, 2016

---

# Add in callback

 *  [TheLocke](https://wordpress.org/support/users/thelocke/)
 * (@thelocke)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/add-in-callback/)
 * I’m trying to add Banners after every load `almComplete()`, but the problem is
   that must of the AdServers give a <script> tag and when I do:
 *     ```
       <script>
               /* <![CDATA[ */
                   $.fn.almComplete = function(alm){
                     $('.alm-seo').append('<div class="m-block m-block--grid article"><header class="m-block__header cf"><h6>publicidad<\/h6><\/header><div class="pinnned_wrapper"><div class="m-block__body cf"><figure data-dimensions="300x250" class="lazyload" style="width: 300px;"><script> eplAD4M("970x90_a"); <\/script><\/figure><\/div><\/div>');
                   };
                   console.log('Done');
               /* ]]> */
           </script>
       ```
   
 * When I clicked LoadMore , the posts aren’t loaded, instead something really odd
   happened ,
    the page load only :
 *     ```
       <html><head></head><body><div id="eplAdDiv970x90_a"></div></body></html>
       ```
   
 * and everything else disappears.
 * and Cosole Log gave me: `alm-seo.min.js?ver=1.5.2:23 Uncaught TypeError: Cannot
   read property 'top' of undefined`.
 * Maybe the solution is inside the repeater with php and a `$count++` but I don’t
   know if that can be done .
 * Thanks
 * **UPDATE**
 * I forgot to tell that if I remove :
 *     ```
       <script> eplAD4M("970x90_a"); <\/script>
       ```
   
 * from the callback , the Div is printed right after all the post are loaded
 * [https://wordpress.org/plugins/ajax-load-more/](https://wordpress.org/plugins/ajax-load-more/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/add-in-callback/#post-7695762)
 * Hi,
    I’m not fully following what you are trying to do…. But the one issue may
   be the script tag in the complete callback.
 * I believe you should be using the getScript() function for this.
 * Make sense?

Viewing 1 replies (of 1 total)

The topic ‘Add in callback’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

## Tags

 * [callbacks](https://wordpress.org/support/topic-tag/callbacks/)

 * 1 reply
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/add-in-callback/#post-7695762)
 * Status: not resolved