0

I found several questions about how to declare regular JS functions within jQuery. But how to define a jQuery function within "jQuery(function ()" ?

1 Answer 1

2

You can try with:

jQuery.fn.foo = function() {
  return 'bar';
}
Sign up to request clarification or add additional context in comments.

1 Comment

Could you elaborate please? Where should I declare the "foo" function? How/where to call it?

Your Answer

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.