我正在缓存像这样的jquery元素
var $stepList = $('#stepList > li');
var $tableRowList = $('.tablesorter-js tbody > tr');
//and use them in the function
pages = {
buildDetail: function ($stepList, $tableRowList) {
console.log($stepList, $tableRowList)
});
}
// this function is invoked many times
pages.buildDetail($stepList, $tableRowList);
是否有更有效的方法来缓存和检索元素,因为我在buildDetail()中会有更多缓存元素?