Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7563071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:34:16+00:00 2026-05-30T13:34:16+00:00

This is for a jQuery Mobile app using version 1.0.1. I’m trying to get

  • 0

This is for a jQuery Mobile app using version 1.0.1.

I’m trying to get data from my getmovies.php file, which outputs JSON, to use in a jQuery function which appends the data to an unordered list on my HTML page.

My HTML page displays correctly, but the getMoviesList() function does not append any list items, so the content area is left blank.

My guess is that there is something wrong with my $.each() function. I’m more comfortable with PHP, but trying to get more familiar with jQuery and JSON for moving data around within jQuery Mobile apps.

getmovies.php outputs JSON as follows:

{"items":[
{"movieID":"65086","title":"The Woman in Black","poster":"\/kArMj2qsOnpxBCpSa3RQ0XemUiX.jpg"},
{"movieID":"76726","title":"Chronicle","poster":"\/853mMoSc5d6CH8uAV9Yq0iHfjor.jpg"}
]}

My Javascript is as follows:

var serviceURL = "http://mydomain.com/app3/services/";

var movies;

$('#moviesPage').bind('pageinit', function(event) {
  getMoviesList();
});

function getMoviesList() {
  $.getJSON(serviceURL + 'getmovies.php', function(data) {
    $('#moviesList li').remove();
    movies = data.items;
    $.each(movies, function(index, movie) {
      $('#moviesList').append('<li><a href="movie-details.html?movieID=' + movie.movieID + '">' +
      '<img src="posters/' + movie.poster + '"/>' +
      '<h4>' + movie.title + '</h4>' +
      '<p>Other details...</p>' +
      '</a></li>');
    });
    $('#movieList').listview('refresh');
  });
}

My HTML looks like this:

<div id="moviesPage" data-role="page">

  <div data-role="content">

    <ul id="moviesList" data-role="listview" data-filter="true"></ul>

  </div><!-- /content -->

</div><!-- /page -->

I’m trying to modify the following example app to meet my needs: http://coenraets.org/blog/2011/10/sample-application-with-jquery-mobile-and-phonegap/.

Thanks for any help you can offer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:34:17+00:00Added an answer on May 30, 2026 at 1:34 pm

    Verify if your JSON output is valid: verify here jsonlint.com

    Change your bind event to this and see if it’s working.

    $('#moviesPage').bind('pageinit', function(event) {
        getMoviesList();
    });
    

    to this

    $('#moviesPage').live('pageshow', function(event) { //or 'pagecreate'
        getMoviesList();
    });
    

    As i can see, the rest of JS code is ok!
    Try this and see if it’s working. As i know, it should! This is the method i use on my mobile app and works very well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to develop an iPhone app using PhoneGap and jQuery Mobile. This
I've built a Jquery Mobile Android App using Phonegap which contains a form with
I have created app using jQuery Mobile and need to get a Dialog box
I'm diving into writing a mobile app with jQuery Mobile/PhoneGap. I'm using this sample
Say I have a mobile web app written using JQuery Mobile, this app retrieves
I can run this code in Android app (using PhoneGap adn jQuery Mobile) but
I'm trying to build a menu for a mobile app (using jQuery Mobile). I
I'm using PhoneGap + jQuery Mobile for a new mobile app. This plugin is
I've been toying with writing a web app using jquery mobile which makes use
Using this jquery code: <a href=javascript:void(0) id=m1>Get Selected id's</a> jQuery(#m1).click( function() { var s;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.