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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:49:05+00:00 2026-05-16T08:49:05+00:00

Let’s imagine that we have something like: $.post(‘somescript.php’, ‘WHAT CAN WE PUT HERE?’, function(replyData)

  • 0

Let’s imagine that we have something like:

$.post('somescript.php', 'WHAT CAN WE PUT HERE?',
        function(replyData) {

1)
By default, the third argument of $.POST method, will read the XMLResponse response correct?
So, why do we need that argument ‘replyData’ ? What are the reasons that we may have for having that argument?

2)
The second argument accepts the data that will be sent. Ok.
I would like to use json, however, I’m not sure if I should use a json format on that second argument or target the input form field that will contain that data?

Additional notes:
The data will come from a input field, and I need to send it via an $.POST ajax request to the server. I intend to use json encode and json decode php functions.

Thanks in advance,
MEM

  • 1 1 Answer
  • 1 View
  • 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-16T08:49:06+00:00Added an answer on May 16, 2026 at 8:49 am

    The replyData argument contains the body of the response returned by the server, which you can then manipulate to display on your page, verify that the server-side processed the data successfully, etc. You don’t have to use it (for example, if you don’t return any data).

    The data that you’re supplying (in JSON format), will still need to be in the form of a query string, e.g. param=value. The value will also need properly encoding, using encodeURIComponent():

    $.post('somescript.php', 'data='+encodeURIComponent(myJSON),
        function(replyData) {
    

    Then, you can access the JSON in the PHP script through the $_POST superglobal:

    $data = json_decode($_POST['data']);
    

    JSON would be a little overkill for a simple input field, however. It’s uncommon to use JSON in place of name/value pairs for form fields.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Let me explain best with an example. Say you have node class that can
Let's suppose I have a Discussion model, and that a discussion can be tagged.
Let's say that I have a set of relations that looks like this: relations
Let's say I've got a collection of 10 million documents that look something like
Let's say I have a function in a view that triggers when some kind
Let's imagine you have a fullscreen C++ desktop application that consists of several screens
Let's have an example like below: package xliiv.sandbox; import android.app.Activity; import android.os.Bundle; import android.util.Log;
Let's say I have a table with a Color column. Color can have various
Let's say that I have a SQLite database that I create in a separate

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.