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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:15:24+00:00 2026-06-16T11:15:24+00:00

Can some one help or explain to me how this works please? i have

  • 0

Can some one help or explain to me how this works please?
i have in my view:

 <script type="text/javascript">
   var jqxhr = $.getJSON("<%= Url.Action("GetTrainingModulePoints" , "Home") %>", function (json) {
    console.log(json);
    });
 </script> 

GetTrainingModulePoints should return 4 rows each containing a value for interactiontype and a value for points

in the console log i just get [object object]?
how can i see what is in the variable json?

http://imageshack.us/photo/my-images/542/firebug.png/

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-16T11:15:25+00:00Added an answer on June 16, 2026 at 11:15 am

    Look at the Network tab in FireBug or similar javascript debugging tool. There you will see the AJAX request and all you have to do is expand the request and look at the response.

    Here’s for example how that might look like in FireBug for a sample AJAX request:

    enter image description here

    And if you click on the JSON tab you will see the output formatted as a JSON object where you could expand/collapse the properties.

    If for some very weird reason you cannot use a javascript debugging tool in your web browser (I don’t know even know how you could be developing a web application, but …) you could use the JSON.stringify method that’s built into modern browsers:

    var jqxhr = $.getJSON("<%= Url.Action("GetTrainingModulePoints" , "Home") %>", function (json) {
        alert(JSON.stringify(json));
    });
    

    And if you are not using a modern browser which doesn’t have the JSON.stringify method natively built-in you could still reference the json2.js script to your page.


    UPDATE:

    OK, it seems that your confusion comes from the fact that you are getting {"success":true} whereas you were expecting to get the rows from your stored procedure. I know this because I answered your previous question.

    Here’s how your controller action look like:

    [HttpGet]
    public JsonResult GetTrainingModulePoints()
    {
        var currentUser = ZincService.GetUserForId(CurrentUser.UserId);
        ZincService.TrainingService.GetTrainingModulePoints(currentUser.UserId);
        return Json(new { success = true }, JsonRequestBehavior.AllowGet);
    }
    

    As you can see in this controller action you are always returning success = true. If you want to return the results from your stored procedure you could do this:

    [HttpGet]
    public JsonResult GetTrainingModulePoints()
    {
        var currentUser = ZincService.GetUserForId(CurrentUser.UserId);
        var modulePoints = ZincService.TrainingService.GetTrainingModulePoints(currentUser.UserId);
        return Json(
            new { 
                success = true, 
                modulePoints = modulePoints 
            }, 
            JsonRequestBehavior.AllowGet
        );
    }
    

    Here I assume that your TrainingService.GetTrainingModulePoints method is actually returning some object. If this is not the case you will have to explain what those methods are doing and how do you expect to get the output.

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

Sidebar

Related Questions

Possible Duplicate: JavaScript: formatting number with exactly two decimals Can some one please help
Can any one please help me solve this. I am resizing some flash object/embed
Could someone please help explain why I can't get this to work? I properly
can some one explain why I face problem with backgroundworker backgroundWorker1_RunWorkerCompleted works just fine
I have a query with regards to pointers, can someone help explain the following
Can someone please explain why this doesn't work? MyClass myClass1 = new MyClass(); object
OK, I hope I explain this one correctly. I have a struct: typedef struct
Hopefully I can explain this without overcomplicating the issue, so please bear with me.
Can someone help me achieve multiple zend pagination in a view using ajax. I
Can someone help by showing me how to sort a LINQ expression. I have

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.