0

我正在尝试了解 FlexiGrid 的flexigrid

在第 1161 和 1163 行,我理解 jQuery 选择器: $('div',g.pDiv).html(html); & $('.pReload',g.pDiv).click(function(){g.populate()}); 但是这些看起来不像多个选择器,请建议我理解这段代码。

                $('div',g.pDiv).html(html);

            $('.pReload',g.pDiv).click(function(){g.populate()});

问候

4

1 回答 1

1

第二个参数$(selector, context)是要在其中查找该选择器的上下文,因此:

$('div',g.pDiv).html(html);

真的

$(g.pDiv).find('div').html(html);

...所以它正在寻找插件保存引用的<div>存储元素内的元素。g.Div

于 2010-11-27T19:06:41.893 回答