Justin Carlson
Justin Carlson

Reputation: 2710

jQuery calling function after ajax load

I have this function being declared on initial page load.

$.fn.tester = function() {
    alert("Test");  
}

I'm then making an ajax call using load()

In the ajax page returned, I am trying to use this function and am giving the error Object # has no method 'tester'.

I am new to jQuery and unsure where to begin to fix this.

Upvotes: 0

Views: 156

Answers (1)

JackWink
JackWink

Reputation: 666

Make sure you aren't redefining the $ operator. This will happen if you are accidentally including jQuery twice, or if you are defining the $.fn before jQuery is included.

Upvotes: 1

Related Questions