I am building a JavaScript application that makes AJAX requests to a PHP API Back-end to load JSON data for different views.
The app UI consist mainly of a left sidebar menu which has items loaded that when clicked on will create a View for a Right content panel. Like this image...
The left sidebar will have up to 60 items which all will be responsible for loading any 3rd party libraries that the item needs on its right content panel as well as initiating any DOM event needed for that view and loading any JSON data from the remote API server.
QUESTIONS
My main question is when a left sidebar item builds the right content panel UI for an item and then later that same item is clicked again which would build it again. How can I go about making sure the whole app doesn't end up having all the items libraries and JSON data and other data built which would bog down the apps memory usage?
I do not want to use a library like BackboneJS or AngularJS. Just pure JS is my goal with exception of 3rd party libraries that tyhe sidebar items/modules will need.
Any tips appreciated I have been researching for a while now without much luck in finding information on this!
