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

  • Home
  • SEARCH
  • 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 7936201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:08:28+00:00 2026-06-03T22:08:28+00:00

In my webapp I have a page where I use getJSON to get data

  • 0

In my webapp I have a page where I use getJSON to get data from server. Firebug shows that it get’s JSON from server just the way it is supposed to, but no data is shown. What could be the problem? Here is what my code looks like:

 $('#detailsPage').live('pageshow', function(event) {
    var id = getUrlVars()["id"];
    $.getJSON(serviceURL + 'getemployee.php?id='+id+'&callback=?', displayEmployee);
});

function displayEmployee(data) {
    var employee = data.item;
    $('#employeePic').attr('src', 'pics/' + employee.PIC);
    $('#fullName').text(employee.NAME);
    $('#employeeTitle').text(employee.TITLE);
    $('#lisatieto').text(employee.INFO);


    if (employee.puhelin_nro) {
        $('#actionList').append('<li><a href="tel:' + employee.puhelin_nro + '"><h3>Soita puhelimeen</h3></a></li>');
        $('#actionList').append('<li><a href="sms:' + employee.puhelin_nro + '"><h3>SMS</h3></a></li>');
    }
    $('#actionList').listview('refresh');

}

Console shows

employee is undefined
[Break On This Error]   

$('#employeePic').attr('src', 'pics/' + employee.PIC);

This is the JSON response:

jQuery164008509381752724021_1336981793995({
    "key": [
        {
            "PIC": "Tuntematon",
            "NAME": "0",
            "TITLE": "0",
            "INFO": "0"
        }
    ]
})
  • 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-06-03T22:08:30+00:00Added an answer on June 3, 2026 at 10:08 pm

    You need to use this

    var employee = data.key[0];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone WebApp that is installed to the home page. When a
When you use JSF, you'll have the controller servlet javax.faces.webapp.FacesServlet that will be mapped
In my JSF 1.2 webapp I have a page with a <h:commandButton> that invokes
I have a filter that I use for lang support in my webapp. But
I use sitemesh for page decoration in my web app. I have a form
I have a .Net 1.1 webapp with a aspx page with the attribute SmartNavigation=true
I have a SQL interface page in my classic ASP web app that allows
multiple webapp running on same tomcat using same jvm. sometime, one webapp that have
I use Spring Security 3 in my JSF2 webapp. I have a security rule
I have a mobile webapp that I am developing using jquery mobile. I am

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.