We are creating a dynamic web application where only some parts of the web page will get loaded/unloaded/reloaded through JQuery AJAX.
But we are concerned what will hap
If you bind all of the functions to some object you can free the object with all the functions any time you want. For example:
function badFunction(a,b,c) {
alert("Bad example of function. Can't cleanup this.";
}
var gameObject = new Object();
gameObject.goodFunction = function (a,b,c) {
alert("Good example of a function");
}
//Here the whole gameObject 'module' will be allowed to be garbage collected (hopefully).
gameObject = null;