// when clicking a menu-item ... this also matches some links within the page, which want to reload the whole content $('#menu a').livequery('click', function(event) { //start function when any link is clicked var page = $(this).attr("title"); //retrieve title of link so we can compare with php file if(page != "logout"){ $(".content").slideUp("slow"); $.ajax({method: "get",url: "content.php",data: "page="+page, beforeSend: function(){$("#loading").show("fast");}, //show loading just when link is clicked complete: function(){ $("#loading").hide("fast");}, //stop showing loading when the process is complete success: function(html){ //so, if data is retrieved, store it in html $(".content").show("slow"); //animation $(".content").html(html); //show the html inside .content div } }); //close $.ajax( } // close if }); //close click( // set done $('a.switchcountry').livequery('click', function(event) { //start function when any link is clicked countryid = $(this).attr("country"); $.ajax({method: "get",url: "content.php",data: "page=switchcountry&country="+countryid , beforeSend: function(){ /*nothing*/ }, //show loading just when link is clicked complete: function(){ /*nothing*/ }, //stop showing loading when the process is complete success: function(html){ //so, if data is retrieved, store it in html $('div.country').html(html); } }); //close $.ajax }); //close click