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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:00:01+00:00 2026-05-31T07:00:01+00:00

I’m calling a JSON object and in Firebug it returns this response : [{\employee\:{\account_id\:1,\active\:true,\activity_ical_hash\:\af2d0f784ce28bc16d6fdf593d3e4bc7\,\address\:null,\admin\:false,\all_tasks_ical_hash\:\d4067eceea22b2f281c65f22ccc7820f\,\always_send_daily_schedule\:true,\api_token\:\8d4ab012505392a25d1469e33945d9b05365eedb\,\can_login\:true,\cell_phone\:null,\city\:null,\created_at\:\2012-02-20T09:41:27-08:00\,\custom_datetime1\:null,\custom_datetime10\:null,\custom_datetime2\:null,\custom_datetime3\:null,\custom_datetime4\:null,\custom_datetime5\:null,\custom_datetime6\:null,\custom_datetime7\:null,\custom_datetime8\:null,\custom_datetime9\:null,\custom_number1\:null,\custom_number10\:null,\custom_number2\:null,\custom_number3\:null,\custom_number4\:null,\custom_number5\:null,\custom_number6\:null,\custom_number7\:null,\custom_number8\:null,\custom_number9\:null,\custom_text1\:null,\custom_text10\:null,\custom_text2\:null,\custom_text3\:null,\custom_text4\:null,\custom_text5\:null,\custom_text6\:null,\custom_text7\:null,\custom_text8\:null,\custom_text9\:null,\email_address\:\mckenna_moore@schumm.org\,\email_schedule_daily\:true,\employee_number\:4,\hashed_password\:\cbc689313dfd6fd144f7df117c4f18e1627afde4\,\hide_pricing\:null,\home_phone\:null,\id\:4,\is_account_owner\:false,\jobs_ical_hash\:\d51abd7af0326083f9d25c4aacc828c0\,\limit_access_to_assignments\:false,\name\:\Horacio

  • 0

I’m calling a JSON object and in Firebug it returns this response :

"[{\"employee\":{\"account_id\":1,\"active\":true,\"activity_ical_hash\":\"af2d0f784ce28bc16d6fdf593d3e4bc7\",\"address\":null,\"admin\":false,\"all_tasks_ical_hash\":\"d4067eceea22b2f281c65f22ccc7820f\",\"always_send_daily_schedule\":true,\"api_token\":\"8d4ab012505392a25d1469e33945d9b05365eedb\",\"can_login\":true,\"cell_phone\":null,\"city\":null,\"created_at\":\"2012-02-20T09:41:27-08:00\",\"custom_datetime1\":null,\"custom_datetime10\":null,\"custom_datetime2\":null,\"custom_datetime3\":null,\"custom_datetime4\":null,\"custom_datetime5\":null,\"custom_datetime6\":null,\"custom_datetime7\":null,\"custom_datetime8\":null,\"custom_datetime9\":null,\"custom_number1\":null,\"custom_number10\":null,\"custom_number2\":null,\"custom_number3\":null,\"custom_number4\":null,\"custom_number5\":null,\"custom_number6\":null,\"custom_number7\":null,\"custom_number8\":null,\"custom_number9\":null,\"custom_text1\":null,\"custom_text10\":null,\"custom_text2\":null,\"custom_text3\":null,\"custom_text4\":null,\"custom_text5\":null,\"custom_text6\":null,\"custom_text7\":null,\"custom_text8\":null,\"custom_text9\":null,\"email_address\":\"mckenna_moore@schumm.org\",\"email_schedule_daily\":true,\"employee_number\":4,\"hashed_password\":\"cbc689313dfd6fd144f7df117c4f18e1627afde4\",\"hide_pricing\":null,\"home_phone\":null,\"id\":4,\"is_account_owner\":false,\"jobs_ical_hash\":\"d51abd7af0326083f9d25c4aacc828c0\",\"limit_access_to_assignments\":false,\"name\":\"Horacio Johnson\",\"notification_email_address\":\"tyrell.bartoletti@donnellyerdman.biz\",\"notification_mobile_host\":null,\"notification_mobile_number\":null,\"notify_on_tasks\":true,\"notify_on_tasks_by_sms\":true,\"notify_via_email\":true,\"notify_via_mobile\":false,\"pager\":null,\"public_tasks_ical_hash\":\"592b2d4150ef46821c2ae8df63ca686d\",\"remember_me_token\":null,\"remember_me_token_expires_at\":null,\"salt\":\"35f1a3c4\",\"show_setup_tab\":null,\"state\":null,\"tech\":true,\"updated_at\":\"2012-02-20T09:41:27-08:00\",\"username\":\"user_marguerite\",\"zip_code\":null}}]"

What syntax would be required to return the name attribute in each returned element?

I tried this, but it didn’t work

$.getJSON(window.location.pathname+'.json?employees='+$("input").attr('value'), function(data){

           $available_names = []
              $.each(data, function(i, val) {
                $name = val.name;
                $available_names.push($name);
              });

});

Anyone know why this doesn’t work?

Update

Trying to add an error handler on this method and this won’t even run. It fails for some syntactical reason :

$.getJSON(window.location.pathname+'.json?employees='+$("input").attr('value'), function(data){

}).error(function() { alert("error"); });
  • 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-31T07:00:03+00:00Added an answer on May 31, 2026 at 7:00 am

    Your data is in an Array structure. It appears as though it’s meant to be an Array of employee objects.

    To get the name of each employee, you’d need to access the employee property of each object.

      $.each(data, function(i, val) {
        $name = val.employee.name;
        $avaiable_names.push($name);
      });
    

    …but if you’re building an Array, you could use $.map instead…

      var $avaiable_names = $.map(data, function(val, i) {
          return val.employee.name;
      });
    

    If it still isn’t working, then check to see if your JSON is being double encoded. There’s something about that Firebug output that makes me think that may be the case.

    You can test this by having the response parsed again, like this…

    data = $.parseJSON(data);
    

    If it starts working, then it is definitely being double encoded on the server, so you’d want to fix that.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am trying to render a haml file in a javascript response like so:
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
i got an object with contents of html markup in it, for example: string

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.