使用$('#a>.b')
,提示:Checks that jQuery selectors are used in an efficient way. It suggests to split descendant selectors which are prefaced with ID selector and warns about duplicated selectors which could be cached.
没看懂它说要干嘛,只看懂了说要把有id选择器为前缀的后代选择器分开来,然后说要缓存...那到底是要怎么分开来?$('#a').find('.b')
这样吗?缓存的话,我只用到一次啊,没必要缓存啊
=========
好吧,连歪果仁都不知道
http://stackoverflow.com/questions/12674591/inefficient-jquery-usage-warnings-in-phpstorm-ide
如果浏览器不支持document.querySelector()那么jquery就会利用sizzle模块切割选择器在用find方法查询。
直接find查询
个人见解,有误请指正。