insert the loading spinner with .getJson
So that's what I'm trying to do...insert a spinner and hide it when the page content is loaded but it's not working. Here's what I have:
- $('#mainNews').on('pageinit', function(event) {
- $.mobile.showPageLoadingMsg();
- getNews();
- });
- function getNews() {
- $.getJSON('file.php', function(data) {
- $.each(data, function (i, u){
- append-to-listview;
- }
- $('').listview('refresh');
- $.mobile.hidePageLoadingMsg();
- });
- }
This seems simple but I can't get it to work.