$.mobile.changePage after some operation on next page! How?

$.mobile.changePage after some operation on next page! How?

Hi, i have a little problem (i hope).

In a my script when the user click on a link to page2  i need to do some operation before the transition. How i can?

Follow my script:
  1. $(".team-link").live("click",function(){
  2.    
  3.          var id_team = $(this).attr("id");
  4.          var where = "id_team="+$(this).attr("id");
  5.          $("#page3 .page-add-player").attr("title", id_team);
  6.          var team = $(this).attr("title");
  7.          $("#team_page .team_page_header h1").html(team).attr("title",id_team);
  8.          
  9.          $("#team_page fieldset").html("");
  10.          
  11.          list_players_team(where);
  12.    //after the previusly operation i want the transition to #team_page
  13.         $.mobile.changePage('#team_page', { transition: "slide" } )
  14.              
  15.                })

How you can see my script is simple, when i click on team-link start some operation and after these start transition. Oviusly this script not work because actualy after the transition i still see the work of list_players() function.

Thanks for any helps !