599644 599644 - 1 year ago 62
jQuery Question

jQuery & boostrap: What does fn[NAME] do?

I am going through the javascript code for bootstrap.

In modal.js I see:

$.fn[NAME] = Modal._jQueryInterface
$.fn[NAME].Constructor = Modal


What does
do? I know what plain
is, not sure about the
and thee

Answer Source

It is same as doing $.fn.modal = Modal._jQueryInterface but using [] notation instead of dot notation

Creates a plugin function to allow you to do $(selector).modal()

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download