前端之家收集整理的这篇文章主要介绍了
AJAX 学习笔记--patter,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
1.) DoSomethingLocal is defined as $.fn.DoSomethingLocal. You can add as many custom functions to the jQuery.fn (or simply $.fn) object as
required by your plugin implementation. Any function you add to the $.fn object is assumed to work on references to an instance of an element/object that was selected. This is what the $.fn
Syntax means - we are simply adding a custom interface to a jQuery object that assumes selected elements. 2.) DoSomethingGlobal is applied directly to the global jQuery object as $.DoSomethingGlobal. A function attached to the jQuery framework in such way assumes that it will not work on selected elements but rather it will work in the global scope and contain practically any implementation.