|Posted by:||Laser Lips (loudsphie…@gmail.com)|
|Date:||Mon, 19 Oct 2009|
I've got a single window application where there are no page loads or
page changes. All the content is dragged down via ajax including new
Most screens are broken up into files on the server.
command. most screens have a 'setUp' function, which is called after
the content is dowloaded to the page to initialise variables etc. Some
pages do not have this setUp function but I found that (seems obviouse
any functions with the same name, and any that are not over written
are still present in the browser.
So if a page that get's ajaxed down does not have the setUp function,
and I call setUp, the setUp function is still trying to work with the
previous screen, but in fact should not have been called.
I've tried many things to clear out old functions but all methods have
adding adn removing them from the head, but once loaded, even after
removing them, the functions they contained are still present.
I've declared functions like this...
then to remove them is used a loop like this...
for(n in window)
This worked quite well but the pages themselves that were ajaxed down
appeared not to be able to see the functions.
So my question is how can I load some functions, do what I need to do
and then remove them afterwards.