With $.getScript I can load js files on the fly. Is it possible to \"unload\" some of these files ?
I have a ajax-based administrative panel. I have 3 sections. When
What I would do in this case would be to make all your JavaScript code part of an object structure then simply set the object to null once done with it.
var myObj = {
"property1": true,
"property2": "Hello my name is Sam.",
"mynamedfunction": function(){
//do stuff
},
"othernamedfunction": function(){
//do other stuff
}
};
Once done set myObj=null;
So rather than loading and unloading a file you are loading and unloading an object as needed! So you would load the file containing the object in, but then set the object to null once done with it, you can even load it in again after destroying it this way.