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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:35:04+00:00 2026-06-04T15:35:04+00:00

I have been looking for an answer to this all afternoon and i cant

  • 0

I have been looking for an answer to this all afternoon and i cant seem to find the best way to accomplish what i need to.

My JSON string (returned from a web service) has circular references in it (#ref) which point to $id in the string. Now i know that if use jquery parseJSON it creates the javascript object and i can access properties a la myObject.MyPropertyName. However, when i get to a #ref, i am unsure how to get the object that ID points to (which i assume is already created as a result of the de-serialization…

Should i be iterating though the object and all its child objects until i find it, or is there an easier way?

$.ajax({
        type: "POST",
        url: "/Task.asmx/GetTask",
        data: "{'id':'" + '27' + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            _Data = $.parseJSON(msg.d ? msg.d : msg);
            _this.Company = _Data[0].t_Program.t_Company;
            _this.Program = _Data[0].t_Program;
            _this.Task = _Data[0];
        },
        complete: function () {

        }
    });

The area in question is _Data[0].t_Program because it does not return an object but rather returns

_Data[0].t_Program
 {...}
   $ref: "12"

I dont exactly know the best way to get the object with $id “12”. Based on the posts below it seems i should loop through the existing object, but i was hoping there was a jquery function that did that…

Many Thanks!

  • 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-04T15:35:05+00:00Added an answer on June 4, 2026 at 3:35 pm

    No, jQuery is not natively capable of resolving circular references in objects converted from JSON.

    The only library for that which I know is Dojo’s dojox.json.ref module.

    But, your server application serializes that JSON somehow. Don’t tell me that the solution it uses does not offer a deserialisation algorithm!

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

Sidebar

Related Questions

I have been looking for an answer to this and could not find it
I've been looking for this, but can't find the answer. I have an NSMutableArray
I have been looking all over the Internet for an answer to this question
I have been looking around all over and I cannot find a definitive answer
I have been looking around for an answer to this, but couldn't really find
I have been looking all around Bing and Google trying to find this, does
I have been looking around for this but couldn't find an answer anywhere, so
I have been looking all over for an answer to this question, but can't
Good morning. I have been looking all over trying to answer this question. If
I've been looking around for this answer but can't seem to find it. I'm

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.