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

The Archive Base Latest Questions

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

This is giving me headaches, AGAIN. I either don’t understand this ajax response stuff

  • 0

This is giving me headaches, AGAIN. I either don’t understand this ajax response stuff at all, or it’s poorly coded.

Let’s establish an extremely simple example to work with:

register.php:

<?php
echo 'I want some response !!';
?>

ajax call:

$.ajax({
 url: '/register.php',
 type: 'POST',
 data: $('#form-registracia').serializeArray(),
 success: function(e){
   var response = e.responseText;
   alert(response);
 }
});

Alert says undefined. Why? I tried messing with it for hours now, I read the jquery site, nothing helps. I’m sure the PHP file gets executed and that the echo is sent back to ajax.

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

    you are getting undefined because the response returned from the server is contained within e, not e.responseText. responseText is a property of the XHR object, but jQuery encapsulates that for you and provides the responseText as the argument in the success method.

    so in short, change it to this:

    success: function(e){
    var response = e;
    alert(response);
    }

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

Sidebar

Related Questions

While I understand this question is fairly vague since I'm not giving you all
This issue is giving me serious headaches, I don't have a clue what's going
This is giving me major headaches! I'm having trouble even describing the problem in
I understand the principle behind this problem but it's giving me a headache to
When I run player.php it's giving this error: Warning: Cannot modify header information -
I can't figure this out. Capistrano keeps giving me this error: ** [out ::
This snippet of Perl code in my program is giving the wrong result. $condition
Oracle is giving me an error (ORA-00907: missing right parenthesis) when I run this
Const-correctness in C++ is still giving me headaches. In working with some old C
The whole concept of exception handling is giving me headaches. Currently, what I want

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.