Assuming that cache["s"].length = 9, and cache["n"] is an element in the DOM tree,
cache[ "c" ] = $("<div/>");
for( n = cache["s"].length; n >= 0; n-- ){cache["n"].append(cache["c"]); }
seems not working, and I have no clue, why. It appends the div element ONCE instead of 9 times.
However, if I say,
cache[ "c" ] = "<div/>";
for( n = cache["s"].length; n >= 0; n-- ){cache["n"].append(cache["c"]); }
it works, I get 9 elements, but they are not properly inserted into the DOM tree.
What is the problem, how could I solve it without losing speed?
cache[n], no quote?