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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:25:21+00:00 2026-06-14T14:25:21+00:00

Here is my code . The problem I encountered is the code jsonVersionList[0] got

  • 0

Here is my code . The problem I encountered is the code jsonVersionList[0] got a string “[“, actually I want parse jsonVersionList as Json object, I think the reason is JavaScript treat jsonVersionList as a string instead of a Json object . Please help me .Thanks.

    function ajaxGetSystemTraceLog(jsonRequest) {
            var sUrl = "/api/SysTraceLog";
            $.ajax({
                cache: false,
                type: "POST",
                async: false,
                url: sUrl,
                data: jsonRequest,
                contentType: "application/json",
                dataType: "json",
                success: function (result) {
                    var sHtml = buildLogDiv(JSON.stringify(eval(result)));
                    $("#effect").html(sHtml);
                    showCenter("#effect", false, 0, 0);
                },
                error: function (xhr) {
                    alert(xhr.responseText);
                }
            });
        }

        function buildLogDiv(jsonVersionList) {
            var sHtml = "<table style=\"width:100%;\"><tr><td style=\"width:100%;background-color:#005CE6;\"  align=\"right\"><img onclick=\"hide('#effect', false);\" alt=\"close it\" title=\"close it\" src=\"/content/themes/default/images/cancel.png\" width=\"20\" height=\"20\" /></td></tr>";
            sHtml += "<tr><td  style='text-align:left'>";
            sHtml += jsonVersionList[0];
            sHtml += "</td></tr></table>";
            return sHtml;
        }


public class SysTraceLogController : ApiController
    {
        public string Post(QueryTraceLogRequestModel queryTraceLogReq)
        {
            return "[\"1\",\"2\",\"3\",\"4\"]";
        }
    }
  • 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-14T14:25:22+00:00Added an answer on June 14, 2026 at 2:25 pm

    Since you specified json as the dataType result is already a JavaScript object so you just have to pass it to buildLogDiv

    var sHtml = buildLogDiv(result); 
    

    If for some reason jQuery is not parsing your data, use JSON.parse to turn it into a JavaScript object

    var sHtml = buildLogDiv(JSON.parse(result)); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to truncate some code here and running into a problem: <script type=text/javascript> $(function()
since I got python on windows running, here is the next problem I encountered
enter code here My problem is this: in this database the junction table contains
Here a code to demonstrate an annoying problem: class A { public: A(): m_b(1),
i am opening jQuery Dialog through the below code.The problem here is when i
Here is the problem from code chef : A set of N dignitaries have
here is my problem : The code (FooController) : NSString *path = [[NSBundle mainBundle]
Here is the code that cause me problem since few hours: TabItem newTab =
Here is my code. The problem is that the information isn't being alerted. It
I have a problem here with this code. I'm opening a socket, then listening

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.