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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:47:13+00:00 2026-05-15T20:47:13+00:00

In the past I have used the following method to parse the json data

  • 0

In the past I have used the following method to parse the json data appropriately so I can populate a select box:

var request = null;

request = $.ajax({
  type: "POST",
  url: "url goes here",
  dataType: 'text',
  success: function(returned) {
    returned = JSON.parse(returned)

    $.each(returned, function(selectid, item) {
      var sel = $("#" + selectid).get(0);
      sel.options.length = 0;

      $.each(item, function(i, subitem) {
        sel.options[i] = new Option(subitem.text, subitem.value);
      });
    });
    request = null;
  }
});

How do I apply the same technique to the code below, but without a select box, just parse the json into the drawChart function?

$.ajax({
  url: 'chart_json.aspx',
  type: 'POST',
  dataType: 'text',
  success: function(data) {
    drawChart(data);
  }
});
  • 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-15T20:47:13+00:00Added an answer on May 15, 2026 at 8:47 pm

    I think your problem lies in your ajax response, i’d do the following:

    in your response:

    { 
      graphData : [
        ['user1',{v:0.00, f:'0.00'}],
        ['user2',{v:0.00, f:'0.00'}],
        ['user3',{v:0.00, f:'0.00'}],
        ['user4',{v:0.00, f:'0.00'}],
        ['user5',{v:0.00, f:'0.00'}]
      ],
      status : "ok"
    }
    

    in your js:

    $.ajax({
      url: 'get_json.aspx',
      type: 'POST',
      dataType: 'json',//this is important
      success: function(data) {
        //this is not vital, but it's nice to check the response
        if(typeof data === "object" && data.status === "ok"){
            graphData = data.graphData;
            drawVisualization(graphData);
        }
      }
    });
    

    Hope this helps, Sinan.

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

Sidebar

Related Questions

I have used the code supplied in the following CodeProject article in the past
Excuse my limited knoweldge here. In the past I have used Steve Sanderson's method
In the past I have used MAPISendMail to launch Outlook (or whatever the desired
In the past I have used Managed Direct X and DirectShow.Net to play a
I have used JMS in the past to build application and it works great.
I have used Hibernate in the past and I share many people's frustration with
I have used valgrinds massif tool to monitor memory usage in the past. Does
I do used IntelliJ IDEA as my development environment at past and I have
I am trying to incorporate a regular expression i have used in the past
I have the following function: $('#s').autocomplete({ source: function(request, response) { $.get( http://theurl.com/?ajax=true, {s: request.term

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.