Title: Callback functions &#8216;is not a function&#8217; before running correctly
Last modified: August 22, 2017

---

# Callback functions ‘is not a function’ before running correctly

 *  Resolved [Nick Lewis](https://wordpress.org/support/users/nickylew/)
 * (@nickylew)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/callback-functions-is-not-a-function-before-running-correctly/)
 * Hi.
 * Sorry to bombard with so many support requests!
 * I have my JS file being loaded after all the other JS files for the Ajax load
   plugin and one of your function snippets in there to check when the Ajax is complete
   each time it runs.
 * It returns as an `Uncaught Type error: $(...) is not a function` but then correctly
   runs and displays the Ajax Load More Complete! in the console.
 * My code:
 *     ```
       $(document).on('ready', function() {
   
       	// loading animation and fade out
       	$('.things #wrapper .row .loading').delay(10000).fadeOut("slow");
   
       	//isotope masonry of blocks
       	$('#things-posts .alm-listing').isotope({
       		itemSelector: '.item',
       		layoutMode: 'masonry',
       		percentPosition: true,
       		masonry: {
       			columnWidth: 50
       		}
       	});
   
       }); //document ready
   
       $(function() {
       	$.fn.almComplete = function(alm){
       	  console.log("Ajax Load More Complete!");
       	};
       })(jQuery);
       ```
   
 * Is there anything I’m doing wrong here? Or is there a different way to call the
   function so it doesn’t fail first then run okay after that?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/callback-functions-is-not-a-function-before-running-correctly/#post-9430810)
 * [@nickylew](https://wordpress.org/support/users/nickylew/) No worries at all.
   
   You might as well move the
 *     ```
       $.fn.almComplete = function(alm){
           console.log("Ajax Load More Complete!");
       };
       ```
   
 * function into your document.ready function since it is not throwing an error.
 * For JS errors like this it would be much faster to first seasrch [Google](https://www.google.ca/search?q=Uncaught+Type+error:+%24(...)+is+not+a+function)
   for this error – lots of results for this exact bug as well as found in the [FAQ](https://connekthq.com/plugins/ajax-load-more/docs/faqs/#16)
   🙂
 *  Thread Starter [Nick Lewis](https://wordpress.org/support/users/nickylew/)
 * (@nickylew)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/callback-functions-is-not-a-function-before-running-correctly/#post-9430857)
 * Researched and fixed the issue. Now have no errors.
 * You’re right, I should have researched first before writing on here!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Callback functions ‘is not a function’ before running correctly’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [Nick Lewis](https://wordpress.org/support/users/nickylew/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/callback-functions-is-not-a-function-before-running-correctly/#post-9430857)
 * Status: resolved