创建 jQuery 插件时,
$.fn
函数中应该返回什么?是 return this
还是 return $(this)
?在搜索时,我遇到的一些网站使用前者,而其他网站则使用后者:
return $(this)
: http://www.tvidesign.co.uk/blog/improve-your-jquery-25-excellent-tips.aspx(Tip 10)return this
: http://devheart.org/articles/tutorial-creating-a-jquery-plugin/
这两种方式有何区别?哪种更好?