I’m developing a single page app using jQuery, jQuery-ui (specifically the widget factory), and Handlebars. All markup is appended (including Home).
There are going to be enough pages to question whether the DOM can grow too big and effect performance.
Scenario: User navigates to page “Forms” from “Home”.
[LIST][*]
“Home” is a common page so I keep it on the DOM when navigated away from
“Forms”, which I attach a widget to after created from a template, is not a commonly visited page so I remove the page from the DOM when navigated away from
[LIST][*]
Are there any downsides to continuously adding and removing pages, with widgets being attached every time the page is added, to the DOM?
Is there a way to capture and cache a page along with it’s widget so that re-appending the page doesn’t require re-creating the widget over and over?
Is adding widgets such a small demand that it isn’t even an issue?
Hope that was clear enough for everyone
Thanks for any advice