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 6659099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:59:31+00:00 2026-05-26T01:59:31+00:00

I am sending a JSONP request and in the result set is three methods.

  • 0

I am sending a JSONP request and in the result set is three methods.

The problem is after the first function executes, the rest are not.

function syncData(jsonData){
    alert('1');
    getUnreadNotifications(jsonData.getUnreadNotifications);
    alert('2');
    getActiveCL(jsonData.getActiveCL);
    alert('3');
    getActiveCLI(jsonData.getActiveCLI);
}

It will only alert 1. Then stops. Here are the functions… what am I doing wrong?

function getActiveCL(jsonData2){

    var list =$('#ul-cl');
    list.empty();
    var htmldata = '';

    jQuery.each(jsonData2, function() {
        htmldata += '<li data-theme="a" class="ui-btn ui-btn-up-b ui-btn-icon-right ui-li-has-arrow ui-li ui-li-has-count ui-corner-top"><div class="ui-btn-inner ui-li"><div class="ui-btn-text"><a href="#consideration-list-id-' + this.id + '" class="ui-link-inherit">Table ' + this.table + ' - ' + this.guest_name + ' ' + this.created + ' <span class="ui-li-count ui-btn-up-c ui-btn-corner-all">' + this.items + '</span></a></div><span class="ui-icon ui-icon-arrow-r ui-icon-shadow"></span></div></li>';
    });
    list.append(htmldata);
    list.listview();
    list.listview('refresh');
    $('a[href="#consideration-list-listing"] .ui-li-count').html(jsonData2.length); 
}
function getActiveCLI(jsonData){
    var lists =$('[id^="ul-consideration-list-id-"]');
    lists.empty();
    alert(jsonData);
    jQuery.each(jsonData, function() {
        var list = $('#ui-consideration-list-id-'+ this.cl_id);
        //timeElapsed = elapsedpretty(this.created);
        alert(list.size());         
        var htmldata = '<li data-theme="a" class="ui-btn ui-btn-up-b ui-btn-icon-right ui-li-has-arrow ui-li ui-li-has-count ui-corner-top"><div class="ui-btn-inner ui-li"><div class="ui-btn-text"><a href="#item-id-' + this.item_id + '" class="ui-link-inherit">' + this.name + '</a></div><span class="ui-icon ui-icon-info ui-icon-shadow"></span></div></li>';
        list.append(htmldata);
    });
    lists.listview();
    lists.listview('refresh');
}

function getUnreadNotifications(jsonData){
    // Build Lists
    var appendData = '';
    var list = $('#message-ul');
    var lastID = 0;
    var messageCount = [];
    var currentVal = parseInt($('.nav a[href="#message-listing"] .ui-li-count').html());
    jQuery.each(jsonData, function() {
        appendData +='<li id="mid-'+this.id+'" data-theme="a" class="ui-btn ui-btn-up-b ui-btn-icon-right ui-li-has-arrow ui-li ui-li-has-count ui-corner-top ui-li-static ui-body-a" ><span class="ui-icon ui-icon-alert ui-icon-shadow"></span><div class="ui-btn-inner ui-li  ui-li-static ui-body-a"><div class="ui-btn-text">Table '+this.table+' - '+this.created+'</div></div></li>';
        lastID = this.id;
    });
    // Prepend new messages

    list.prepend($(appendData).hide()).children().slideDown();
    $('a[href="#message-listing"] .ui-li-count').html(currentVal + jsonData.length);
    // Set last checked id
    if(lastID !== 0) localStorage.setItem('last_message_id', lastID);

    list.listview();
    list.listview('refresh');
}

And finally the JSON. Tested it all in jsonlint and validates:

syncData({
    "getUnreadNotifications": [
        {
            "id": "98",
            "message_type_id": "2",
            "visit_id": "82",
            "active": "1",
            "created": "2011-10-07 13:42:21",
            "table": "2",
            "rvc_id": "2",
            "zone": "2",
            "seat": "1",
            "guest_name": "Foster Test"
        },
        {
            "id": "100",
            "message_type_id": "4",
            "visit_id": "82",
            "active": "1",
            "created": "2011-10-07 16:11:10",
            "table": "2",
            "rvc_id": "2",
            "zone": "2",
            "seat": "1",
            "guest_name": "Foster Test"
        },
        {
            "id": "101",
            "message_type_id": "5",
            "visit_id": "82",
            "active": "1",
            "created": "2011-10-07 16:11:10",
            "table": "2",
            "rvc_id": "2",
            "zone": "2",
            "seat": "1",
            "guest_name": "Foster Test"
        },
        {
            "id": "102",
            "message_type_id": "3",
            "visit_id": "82",
            "active": "1",
            "created": "2011-10-07 16:11:11",
            "table": "2",
            "rvc_id": "2",
            "zone": "2",
            "seat": "1",
            "guest_name": "Foster Test"
        },
        {
            "id": "103",
            "message_type_id": "2",
            "visit_id": "82",
            "active": "1",
            "created": "2011-10-08 13:22:57",
            "table": "2",
            "rvc_id": "2",
            "zone": "2",
            "seat": "1",
            "guest_name": "Foster Test"
        },
        {
            "id": "104",
            "message_type_id": "4",
            "visit_id": "82",
            "active": "1",
            "created": "2011-10-08 13:22:57",
            "table": "2",
            "rvc_id": "2",
            "zone": "2",
            "seat": "1",
            "guest_name": "Foster Test"
        },
        {
            "id": "105",
            "message_type_id": "2",
            "visit_id": "82",
            "active": "1",
            "created": "2011-10-08 13:23:08",
            "table": "2",
            "rvc_id": "2",
            "zone": "2",
            "seat": "1",
            "guest_name": "Foster Test"
        }
    ],
    "getActiveCL": [
        {
            "id": "9",
            "visit_id": "82",
            "created": 1317949631,
            "items": "6",
            "table": "2",
            "guest_name": "Foster Test"
        }
    ],
    "getActiveCLI": [
        {
            "table": "2",
            "cl_id": "9",
            "item_id": "100010",
            "price": "4300",
            "name": "Anakena"
        },
        {
            "table": "2",
            "cl_id": "9",
            "item_id": "18027",
            "price": "5500",
            "name": "Chicken Shashlik"
        },
        {
            "table": "2",
            "cl_id": "9",
            "item_id": "18016",
            "price": "3500",
            "name": "Chicken Steak Burger"
        },
        {
            "table": "2",
            "cl_id": "9",
            "item_id": "18018",
            "price": "3700",
            "name": "Lamb Sausage Masala Pizza"
        },
        {
            "table": "2",
            "cl_id": "9",
            "item_id": "100370",
            "price": "4300",
            "name": "Lamole di Lamole - Chianti Classico D.O.C.G"
        },
        {
            "table": "2",
            "cl_id": "9",
            "item_id": "100460",
            "price": "4300",
            "name": "Morande Grand Reserve"
        }
    ]
});
  • 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-26T01:59:32+00:00Added an answer on May 26, 2026 at 1:59 am

    TypeError. You sure you’re using an up-to-date version of jqm?

    You’re calling list.listview(); but list.listview is probably undefined. So trying to invoke undefined as a function throws an error. Once the interpretor hits the error it stops executing, so the rest of the script including alerts won’t be called.

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

Sidebar

Related Questions

I'm making an AJAX request and sending along some JSON: $(function() { var json
I've got the following problem: I am sending a AJAX request to a service
I am sending a json request to a server as below: $.getJSON(prod_search.php?type=getCustInfo&custID=+custID, function(json) {
I have a problem with sending a JSON to a Server with REST API.
I'm using Restkit to communicate with Drupal CMS. When I'm sending the first request
Sending request to action using Ajax, the result type is json. Use a json
I am trying to receive a json object back from php after sending data
The http.get() function inside http.createServer is not responding. I wrote a small snippet to
I am sending an AJAX request using POST over X-Domain for a widget we
I need to make a jsonp POST request with the content type 'application/json'. I

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.