javascript - Rebuild element in jQuery vs. mass showing/hiding -
I have a paged table of data that I want to cache client side and I am trying to explain How to switch pages efficiently. Would it be better to do this: A DOM var page Lang = 50 to reconstruct and replace the table through an amendment; Var cache; // array of some objects from the Database Object Changes page (index) {var $ table = $ (" table & gt;); $ .each (cache, function (i, line) {var $ tr = $ ("& lt; tr>"); if (i> l $ .hide (); $ $ Tr.append ($ ("& lt; td & gt;", {text: row.Name})); $ table attached ($ tr);}); $ ("# TargetDiv") HTML ($ table). } or b. DOM The function is showing and hiding rows after inserting the change page (index) {var $ table = $ ("# targetDiv table"); . Hide $ Table.find ("tr: visible"); $ Table.find ("tr"). Each (function (i, line) {if (i> index & amp; amp; i & lt; index + page length) $ tr.show ();}); } I wrote something on the first lin...