Basically, you need to remove all references to these functions so that the JavaScript garbage collector can collect them. If they are connected, you need to untie them. If they have other variables, they should be set to zero.
, - ; .
... EDIT:
, , :
function edit(){
$('.edit').click(function(){
function _edit(boxTitle,selectedItemAmount){
$('#box .yes').click(function(){
alert(boxTitle + ' for ' + selectedItemAmount + ' selected item');
$('#msg').hide();
});
}
$('#box .no').click(function(){
$('#msg').hide();
});
});
, : " DOM", . JavaScript , .
, - , :
function boxClickYes(e) {
alert(e.data.boxTitle + ' for ' + e.data.selectedItemAmount +
' selected item');
$('#msg').hide();
}
function boxClickNo(e) {
$('#msg').hide();
}
function edit(){
$('.edit').click(function(){
function _edit(boxTitle,selectedItemAmount){
$('#box .yes').bind("click", {boxTitle: boxTitle,
selectedItemAmount: selectedItemAmount}, boxClickYes);
}
$('#box .no').click(boxClickNo);
});
, data jQuery , , , ( , ). , (, $.each), , .