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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:46:52+00:00 2026-05-26T17:46:52+00:00

My PHP side sends reponse to ajax like that $data = array( ‘status’ =>

  • 0

My PHP side sends reponse to ajax like that

$data = array(
            'status' => $status,
            'message' => $message
    );
    echo json_encode($data);

My ajax looks like that

$.ajax({
               url: formUrl,
               type: formMethod,
               dataType: "json",
               data: formData,
               success: function (data) {
                  //setup variables
                  var responseData = jQuery.parseJSON(data), cl, text;

                  //response conditional
                  switch (responseData.status) {
                  case 'error':
                     cl = 'error';
                     text = responseData.message;
                     break;
                  case 'success':
                     cl = 'success';
                     text = 'Qeydiyyat uğurla başa çatdı';
                     break;
                  }

                  $.notifyBar({
                     cls: cl,
                     html: text
                  });

               }
            });

Getting responseData is null error message. But (from firebug XHR) I see that php actually echoes result. What could be the reason?

  • 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-26T17:46:53+00:00Added an answer on May 26, 2026 at 5:46 pm

    I believe jQuery is smart enough to parse the response JSON for you such that the data parameter passed to your callback has already been parsed. So you can just access data.status, etc. directly.

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

Sidebar

Related Questions

i've been making web app's and working with various server side language like php,
Using ajax+php in my signup form. There are 2 validations: JS side frontend and
I am currently validating user input on server side (PHP). The client side sends
I have to create a PHP SOAP client that sends leads, but I have
I have some script that takes a form and sends it to php using
I'm writing server-side programs in PHP for an iPhone app. And I have no
I have a website which works with PHP on the server side. Users access
i have a rhel 4 server and use php as a server side scripting
If you wanted to re-create the DOM server-side and manipulate it in PHP, how
For example, writting server-side things using javascript, instend of php.

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.