Loading spinner closes too soon

Loading spinner closes too soon

Hi

Im trying to get the loading message to work with fetching data over JSONP, but i cant attach to the regular AJAX event, as that apparantly dosen't fire, when using JSONP.

My problem is, if i Trigger the    $.mobile.loading( "show") manually, it seems to end right when i hit the next function. Any ideas are very welcome.

I'am doing the following in my code:


$('#mybookings').live('pageshow',function(event){
  showSpinner();
  mybookings();
  hideSpinner();
});

function showSpinner()
{
  $.mobile.loading( "show", {
  text: "",
  textVisible: true,
  theme: "b",
  html: ""
  });
}

function hideSpinner()
{
  $.mobile.loading( "hide" );
}

The mybooking function, fetches booking data, and inserts it into a listview on the page, via JSONP.