In jQuery, what does $.fn. mean? I looked this up on google but couldn't find any concrete examples.
$.fn.something = function{}
Fn is a lightweight Docker-based serverless functions platform you can run on your laptop, server, or cloud.
The Fn key, short form for function, is a modifier key on many keyboards, especially on laptops, used in a compact layout to combine keys which are usually kept separate.
In jQuery, the $ sign is just an alias to jQuery() , then an alias for a function. This page reports: Basic syntax is: $(selector).action() A dollar sign to define jQuery.
fn. extend() method extends the jQuery prototype ( $. fn ) object to provide new methods that can be chained to the jQuery() function.
It allows you to extend jQuery with your own functions.
For example,
$.fn.something = function{}
will allow you to use
$("#element").something()
$.fn
is also synonymous with jQuery.fn
which might make your Google searches easier.
See jQuery Plugins/Authoring
This has been covered in some detail here:
Why jQuery do this: jQuery.fn.init.prototype = jQuery.fn?
But the short of it is that $.fn
is an alias for $jQuery.prototype
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With