I’m using Jquery Mobile. On my page I have a table, which I’m dynamically filling via AJAX.
The user can load details for each record, which I’m also pulling in via AJAX. Currently I’m replacing the table with the detail view.
Since the application will primarily run on mobile devices, I would like to avoid re-requesting the table from the server, since it already has been loaded once (but removed from the DOM when the detail view was loaded).
Question:
Say I don’t want to use local storage, what’s the best way to tuck the table away and re-insert it into my content container when the user tries to go back to the table from the detail-view?
Is there a best practice to do this or should I just create a div.dump, append the whole table and set display=”none”?
I think display=none is a viable solution, and assuming the table is not that large and you don’t need to worry about the underlying data being changed on the server while you are ‘caching’ it, has little downside.