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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:32:11+00:00 2026-06-12T12:32:11+00:00

I have wasted two days on this and I can’t take it anymore. I

  • 0

I have wasted two days on this and I can’t take it anymore. I am getting well formed JSON data from my $.ajax call. Sample below…

"results":[
"{"a":"data","b":"data","c":"data","d":"data"}",
"{"a":"data","b":"data","c":"data","d":"data"}",
"{"a":"data","b":"data","c":"data","d":"data"}",
"{"a":"data","b":"data","c":"data","d":"data"}"
]

I have attempted to access the values in this single array of JSON objects and just can’t figure it out. Here’s my code below…

success:function (data) {

/*
$.each(data.results, function(i, val) {
console.log(i, val);
});
*/

$('a.previewUrl').each(function (i) {
    var res = jQuery.parseJSON(data.results[0]);
    var previewUrl = $(this);
if(previewUrl.attr("href") == '') {
    previewUrl.attr("href", res[i].d);
}

});

} // end success

The console.log iteration over each JSON object in the array prints out fine but I think I have tried a dozen different ways to grab these values in the $.each() loop. What I am missing?

  • 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-12T12:32:12+00:00Added an answer on June 12, 2026 at 12:32 pm

    Your Json isn’t valid. Try putting it through jsonlint and see what happens.

    I think this could be what you were aiming for:

    {
    "results": [
        {
            "a": "data",
            "b": "data",
            "c": "data"
        },
        {
            "a": "data",
            "b": "data",
            "c": "data"
        },
        {
            "a": "data",
            "b": "data",
            "c": "data"
        },
        {
            "a": "data",
            "b": "data",
            "c": "data"
        }
    ]}
    

    and if you’re using jQuery’s $.getJSON function, you don’t need to parse your data or if you’re using the $.ajax function, set the datatype to json so it wil parse the data for you.

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

Sidebar

Related Questions

I've searched for a solution for two days and I can't take it anymore.
From the past two days i have been diving into the concepts of OOPS
I have this little problem. My client wanted two distinct swf on a web
I have spent(wasted) the past two hours googling for a solution. Please help. I
I have two models: class Source(models.Model): name = models.CharField(max_length=200) class Data(models.Model): date = models.DateField(db_index=True)
I have this kind of class and i would like to take variable outside(return
I have two spinners. I am receiving information from server and displaying it in
i have two list, i wanted to update the second list while adding a
I wanted to write a program that test if two files are duplicates (have
I have wanted to try GAE since launch, but coming from ASP .NET and

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.