I have master page (index.html). This page have 2 event click. when click ".eq(0)" there script load a external page with contenet javascript. when click ".eq(1)" there script clean "#Twitter_list" and load external page with contenet javascript. Ok work!. But.... I noticed that when I switch from one page to another javascript code on the previous page remains running how I do before loading a new page in ajax to clean the javascript code on the previous call page with ajax?
ent $("#header_container_menu" ).find('span').eq(0).click(function() {
$.ajax({
cache: false,
type: "GET",
url: "/pinguino/getPage.php",
data: "PageID=TwitterList",
dataType: "html",
success: function(msg){
$("#Twitter_list").html("");
$("#Twitter_list").html(msg);
},
error: function(){
alert("Chiamata fallita!!!");
}
});
})
$("#header_container_menu" ).find('span').eq(1).click(function() {
$.ajax({
cache: false,
type: "GET",
url: "/pinguino/getPage.php",
data: "PageID=TwitterPassword",
dataType: "html",
success: function(msg){
$("#Twitter_list").html("");
$("#Twitter_list").html(msg);
},
error: function(){
alert("Chiamata fallita!!!");
}
});
})
enter code here