Typically you replace the content in a division with the new content.
load in page content and new JS functions for each new page/link and remove old.
So i am trying to build an app that when the use clicks on a menu item istead of just loading the new page it will just get the inner contents of the new page and swap out the current contents with the new contents. The problem i have found is that the old javascript functions from the old content is still active in memory. So, if i had some hook functions or timer functions or some functions that don't get swapped with new functions with the same name, they will still be there.
Is there i was way i should go about loading in JS functions and code for each page content but then remove them when the page content is replaced.
And having said that, i would maybe like to keep some functions still running if possible if i swap out the page content. example: I user is uploading a big file but they want to browse to some other pages, so i want that ajax function to keep uploading the file.
Please or to participate in this conversation.