0

I'm currently learning how to write jquery plugin and I have been told that if I want my plugin to work with jQuery collection in ways similar to the native jquery collection methods, I have to attach it to jQuery.fn object.

Therefore I want to read a bit more about jQuery.fn by reading its documentation page.

Neither google search nor search in jquery.com showed up the documentation page for jQuery.fn object. Does the documentation not exist? Or am I not looking at the right place? Or is it because jQuery.fn is internal implementation detail that we shouldn't touch?

Thor
  • 9,638
  • 15
  • 62
  • 137
  • 1
    `fn` is a prototype of jQuery constructor. Read about it: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain – dfsq Jul 20 '18 at 08:20
  • hi @dfsq, the page you linked does not seem to contain information on `jQuery.fn` object. Do you know if there is any direct documentation related to `jQuery.fn`? – Thor Jul 20 '18 at 08:21
  • Closed as a duplicate. Literally the first hit in Google for 'What is jQuery.fn' – Rory McCrossan Jul 20 '18 at 08:22
  • 1
    It does. It's called `prototype`. If you understand this then you will know jQuery.fn too. – dfsq Jul 20 '18 at 08:22
  • hi @RoryMcCrossan, I'm not asking what `jQuery.fn` is. I'm asking where can I find the documentation page for `jQuery.fn`. The question on the surface appear to be the same, but its actual different – Thor Jul 20 '18 at 08:23
  • As @dfsq has already said there is no documentation as it's just an alias for JS's `prototype`. If you go to the MDN link posted above which covers it's use you will understand it. `jQuery.fn` and `prototype` are the same thing. – Rory McCrossan Jul 20 '18 at 08:24
  • @RoryMcCrossan, could you please reopen my question. I think you may have misunderstood my intention. – Thor Jul 20 '18 at 08:25
  • I have understood your question and the duplicate and the above MDN link answers it completely. There is nothing that could be added to this question which would make it clearer, and which would not just be repeating the content of those other two sources. – Rory McCrossan Jul 20 '18 at 08:25
  • 1
    @RoryMcCrossan, ah ok. Thanks for the clarification. And thanks dfsq for the link – Thor Jul 20 '18 at 08:26

0 Answers0