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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:27:16+00:00 2026-05-26T05:27:16+00:00

I have the following ajax call in my javascript. This call executes correctly, the

  • 0

I have the following ajax call in my javascript. This call executes correctly, the appropriate action is taken on the server, and the server returns status 200 and a JSON object containing: a string name result containing the value "OK" and an array of tuples called aaData. I can see this returned data by spying out the results in Chrome.

My problem is that while alert("Hello") executes as expected, and alert(response) displays “object” (as I would expect); alert(response["result"] displays “undefined”. It appears to me that response has already been parsed into a javascript object and I should be able to use it. Am I wrong? Is there something else I need to do to the object? Or am I addressing its elements incorrectly.

$.ajax( {type:        "PUT",
     url:         "/fund/${fund.name}/contacts",
     data:        payload,
     contentType: "application/json",
     processData: false,
     cache:       false,
     dataType:    "application/json",
     complete:    function(response) {
            alert("Hello");
            alert(response);
            alert(response["result"]);
                if (response["result"] != "OK")
            {
                alert(response["result"])
            }
            else
            {
                $("#fund-contacts").dataTable( {"aaData": response["aaData"]} )
            }
            $("#fund-contact-entry").dialog( "close" );
            alert("Hello");
              }
    }
);
  • 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-26T05:27:17+00:00Added an answer on May 26, 2026 at 5:27 am

    Use the success callback instead of complete.

    From the manual

    success(data, textStatus, jqXHR)

    A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object

    complete(jqXHR, textStatus)

    A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request

    Edit: Also, what @hobbs says above

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

Sidebar

Related Questions

I have following ajax call in my JavaScript code url = 'http://news.ycombinator.com/?callback=?'; $.ajax({url:url ,async:!1,dataType:'script',
I have the following call in my JavaScript: new Ajax.Request('/orders/check_first_last/A15Z2W2', {asynchronous:true, evalScripts:true, parameters:{first:$('input_initial').value, last:$('input_final').value,
Let's say I have the following jQuery AJAX call: $.ajax({ type: POST, url: MyUrl,
The problem is the following. We have lots of ajax call via $.ajax function.
I have the following javascript: $.ajax({ type: "POST", dataType: "json", url: "/Home/Submit", data: {
i have the following javascript to post a form through ajax without refreshing the
I have the following Javascript libraries loaded for my page. <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js></script> <script
I have the following ajax call to update a particular field of a model
I have the following jQuery ajax call setup: function Testing() { var result =
I have the following ajax call: $(#welcome a.close).click(function(e) { $.ajax({ type: GET, url: /visitors/hide_welcome,

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.