2

I have a class:

var BrandDrug = Class.extend({
 fun1: function() {
 $.MyFunc(); //This does not work.
 }
});
//Outside function
$.MyFunc = (function() {
 //Code
});

How can i call the $.MyFunc from the BrandDrug Class?

asked Dec 9, 2009 at 16:36

1 Answer 1

1

You have to define the "$.MyFunc" before the "BrandDrug" class and it will work.

edit: also note that you are not extending jQuery properly. See this tutorial (for example) on how to build proper jQuery plugins.

answered Dec 9, 2009 at 16:37
Sign up to request clarification or add additional context in comments.

1 Comment

I was caught up fixing another bug. Thanks, it helped.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.