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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:37:38+00:00 2026-05-28T16:37:38+00:00

I am pulling my hair out with this. I am trying to invoke a

  • 0

I am pulling my hair out with this. I am trying to invoke a getJSON and the callback function is never triggered. I tried adding an alert as well as firebug debug but the callback never happens.

The service response shows a JSON string so not sure what is going wrong. Any pointers?

Here is my code which calls a Play Framework service:

            var serviceURL = "http://localhost:9000/signup/";

    var employees;

    $('#employeeListPage').bind('pageinit', function(event) {
        $.mobile.allowCrossDomainPages = true;
        getEmployeeList();
    });

    function getEmployeeList() {
        $.getJSON(serviceURL + 'getemployees?callback=?', function(data) {
            alert(data);
            $('#employeeList li').remove();
            employees = data.items;
            $.each(employees, function(index, employee) {
                $('#employeeList').append('<li><a href="employeedetails.html?id=' + employee.id + '">' +
                        '<img src="pics/' + employee.picture + '"/>' +
                        '<h4>' + employee.firstName + ' ' + employee.lastName + '</h4>' +
                        '<p>' + employee.title + '</p>' +
                        '<span class="ui-li-count">' + employee.reportCount + '</span></a></li>');
            });
            $('#employeeList').listview('refresh');
        });
    }

The play service returns a json string.

Anyone see what am i doing wrong? why is the alert never executed?

  • 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-28T16:37:39+00:00Added an answer on May 28, 2026 at 4:37 pm

    Some debugging tips:

    1. Ensure that getEmployeeList() is being called. Put a console.log('getEmployeeList()') command right at the top of that function. If it’s not being called, then my guess would be that #employeeListPage does not exist (at least, not when you are expecting it to.)
    2. Check the URL that you are attempting to call is what you think it is. Log the whole URL.
    3. Use Firebug to look at the requests and responses. Can you see the page being requested? Does it give a valid response? If not, then your success callback function will not be called. Add a failure callback as well.

    EDIT
    Based on comments – seems that the Play framework does not natively support JSONP. I’m not sure whether you have any control over that. http://groups.google.com/group/play-framework/browse_thread/thread/253107904a5c98f8

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

Sidebar

Related Questions

I have been pulling my hair out trying to make this work. I have
I have been pulling my hair trying to figure this out but nothing is
I've been pulling out my hair trying to figure this problem out. I have
I've been pulling my hair out with this function. It's a function within a
I've been pulling my hair out this morning trying to figure this out. I
I'm pulling my hair out trying to resolve this so any tips and help
I'm pulling my hair out on this one. I am trying to implement a
I just spent a few hours pulling my hair out over this. I'm trying
I've been pulling my hair out for hours trying to figure this out. I
I am pulling the hair out of my head trying to figure this one

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.