ChangePage finish event

ChangePage finish event

Hi all,

I need load dinamic page... my page name is dependent from json query returned by server. Then I inject code into my page...

Example:
  1. function xxxx(idUtente, fantagiornata) {
        var jqxhr = $.getJSON("http://xxxxxxxxxxxxxxxx", function(data) {       
            $.mobile.changePage( "myPage" + data.xxx + ".html);   
            setDinamicData(data);   
        })
        .success(function() {  })
        .error(function() { alert("Imposibile caricare la pagina. Riprovare più tardi."); })
        .complete(function() {  });   
    }








If I use this approch, I have syncron problem because setDinamicData is called befaure changePage is completed.

How can I manage changePage event and call "setDinamicData(data);" after?

Thanks

K