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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:30:03+00:00 2026-06-13T06:30:03+00:00

I have json array like this one: [{code : A1, desc : desc1},{code :

  • 0

I have json array like this one:

[{"code" : "A1", "desc" : "desc1"},{"code" : "A2", "desc" : "desc2"}]

How should i parse it in jquery to get data like this:

A1 - desc1
A2 - desc2

I tried lots of different ways, but none of them works. At the moment i have a code like this:

$.ajax({
    url: 'my_url',
    success: function(data) {
        $.each(data, function (key, val) {
            alert(val.code);
        });
    },
    error: function() {
        alert('problem');
    }
});
  • 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-13T06:30:04+00:00Added an answer on June 13, 2026 at 6:30 am

    Ok, i solved my problem. The problem was my hosting provider. I am using Codeigniter as a framework, and return result as json. My hosting provides adds 3 additional lines to the result (uses them for tracking opened pages). Problem was, that i was checking json, which i see in browser, but when i rightclicked and checked source code, i found those lines.

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

Sidebar

Related Questions

I have a JSON array like this: { forum:[ { id:1, created:2010-03-19 , updated:2010-03-19
I have a json object that looks something like this: Array ( [algorithm] =>
I have something like a json array output, it comes like : { data:
I have index.php like this: <script type=text/javascript src=jquery-1.4.2.js></script> <script type=text/javascript src=ajax.js></script> <a href='one.php' class='ajax'>One</a>
[I have some code to create a JSON array. In this code I am
I have a JSON array like below: var jsonArray = [{k1:v1},{k2:v2},{k3:v3},{k4:v4},{k5:v5}] I don't know
I have an array of json objects like so: [{a:b},{c:d},{e:f}] What is the best
i have this JSON: var projects_array = new Array( {name:myName1, id:myid1, index:1}, {name:myName2, id:myid2,
I have some troubles mapping a JSON Array to RestKit. This is what the
hello all i have one json object like {event1:{title:My birthday,start:12\/27\/2011 10:20 ,end:12\/27\/2011 00:00 },event2:{title:My

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.