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

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -