Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is Ajax not getting the data from the table and displaying it?
    primarykey
    data
    text
    <p>I have Get function is PHP which works</p> <pre><code>`// retreive all the movies function movies_get() { $this-&gt;load-&gt;database(); $sql = 'SELECT * FROM movies;'; $query = $this-&gt;db-&gt;query($sql); $data = $query-&gt;result(); $this-&gt;response($data, 200); }` </code></pre> <p><a href="http://creative.coventry.ac.uk/~4078078/moviereviews/v1.0/index.php/movie/movies" rel="nofollow">http://creative.coventry.ac.uk/~4078078/moviereviews/v1.0/index.php/movie/movies</a><br> In apigee I get this result or this link:</p> <pre><code>`{ "id": "1", "Title": "Anna Karenina", "Director": "Joe Wright", "cast": "Keira Knightley Jude Law Arron Taylor-Johnson", "genre": "Drama" },` </code></pre> <p>I am trying to work on AJAX to get the titles of the movies to display on the #movies page. and this is my code, but what it doesn't work, I really can't figure out the error , I am new to AJAX but I have written this code, what is the error, Could it be that i am asking to display titles but it is displaying more than just the title?</p> <pre><code>function Get() { $.ajax({ url: 'http://creative.coventry.ac.uk/~4078078/moviereviews/v1.0/index.php/movie/movies', dataType: 'json', success: function (data) { $.each(data.movie, function (i, id) { $('#movies').append('&lt;li&gt; &lt;a href="" data-transition="slide" onclick="Getmovies(' + movies.id + ')"&gt;' + movies.Title + '&lt;div class="ui-li-count"&gt;' + movies.records + '&lt;/div&gt;&lt;/a&gt;&lt;li&gt;'); }); $.mobile.changePage("#movies"); //show the results page $('#home').listview('refresh'); }, //error: function (response) { //var r = jQuery.parseJSON(response.responseText); //alert("Message: " + r.Message); //} } ) }; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload