Home Unable to display results using jquery ajax
Reply: 0

Unable to display results using jquery ajax

user1584 Published in May 23, 2018, 7:20 am

I am trying to implement a comment feature on my page. I have an itemID 123. on that page, I would like to display the comments that people have posted about itemID 123. However as of now, I am unable to display these comments on my page. There are no errors in the console.


function mywall() {
    var url = serverURL() + "/viewwall.php"; //execute viewwall.php in the server

    itemID = decodeURIComponent(getUrlVars()["itemID"]);

    var JSONObject = {
        "itemID": decodeURIComponent(getUrlVars()["itemID"])

        url: url,
        type: 'GET',
        data: JSONObject,
        dataType: 'json',
        contentType: "application/json; charset=utf-8",
        success: function (arr) {
            _mywallresult(arr); //success. execute _mywallresult()
        error: function () {

function _mywallresult(arr) {
    var i;

    //for all the shouts returned by the server 
    for (i = 0; i < arr.length; i++) {
        //append the following:
        //time of posting </b>
        //the message
        $("#wallcontentset").append("<b>" + arr[i].timeofposting + "</b><br/>" + arr[i].message + "<hr>" + arr[i].userid);


<div data-role="content" class="ui-content" id="wallcontentset"></div>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.50861 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO