javascript - Cachin jquery objects simple code -
javascript - Cachin jquery objects simple code -
i'm trying implement caching , reduced dom manipulation complex js code. want create sure, what's more efficient?
1)
var $thebox = $(".textbox[data-title*='"+dt+"']"); $thebox.remove();
or
2) $(".textbox[data-title*='"+dt+"']").remove();
?
they same if utilize $(".textbox[data-title*='"+dt+"']") 1 time.
it case. if have to re-new 'selector' before remove of them.
you have utilize $(".textbox[data-title*='"+dt+"']").remove();
because $thebox old now.
javascript jquery performance
Comments
Post a Comment