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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:20:20+00:00 2026-05-23T19:20:20+00:00

first of all i’m a complete javascript and jQuery noob so i’m sorry if

  • 0

first of all i’m a complete javascript and jQuery noob so i’m sorry if this question is dumb. but i really haven’t found the answer in the jQuery documentation or on google

i’m trying to perform an action on the response when the request is completed
but i can’t access responseText. i was under the impression the an jqxhr objext has a member responseText. but i get the following error ‘responseText is not defined’.

this.load = function(fileName, actionFunction){
    var jqxhr = $.post(SERVER,{command : "load", filename : fileName})
    .complete(function(){ 
        actionFunction(responseText);
    });
}

EDIT

if i do

.complete(function(responseText){ actionFunction(responseText);}

or what Dave Ward suggest

i don’t get an error but nothing happens

i know it isn’t the actionFunction() because if i input a string manually for testing purposes it does what i expect it to do.

when trying to see what parameter gets past on (prinintg it to the console in actionfunction) i get [object Object]; even when trying to convert it to a string (String(parameter))

END EDIT

what am i doing wrong or how do i access responseText in the .complete function ?

tnx in advance

  • 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-23T19:20:20+00:00Added an answer on May 23, 2026 at 7:20 pm

    The $.post method is shorthand for a call to $.ajax with certain parameters predefined.

    From the documentation on the ajax function from jQuery’s website, the complete callback is passed two parameters: jqXHR and textStatus, where jqXHR is the actual XMLHTTPRequest object.

    So it’s the second parameter you want to pass to your handler:

    .complete(function(jqXHR, responseText) {
      actionFunction(responseText);
    });
    

    Note that, as Dave Ward says in his answer, responseText in this case is really just a status indicator, like “success” or “error” (hence jQuery’s name for it, “textStatus”). Given you have the word “response” in your variable name, I’m guessing (like he is) that you probably want the success callback instead of complete:

    .success(function(data, textStatus, jqXHR) {
      actionFunction(renderDataToString(data));
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all there is a partial question regarding this, but it is not
First of all, this is probably a stupid question, but I'm new and still
First of all I am new to javascript so this question might be stupid.
First of all this is more of a math question than it is a
First of all let me start by saying that this question is not about
First of all, let me apologize if this question is too broad. I'm looking
First of all, I know how to build a Java application. But I have
First of all: I am not an experienced ClearCase user, but I have lots
First of all (in case this is important) I'm using ActiveState's Perl (v5.8.7 built
First of all, sorry for the title. Someone please propose a better one, I

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.