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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:21:18+00:00 2026-05-16T10:21:18+00:00

$.post(‘somescript.php’, { data: $(‘#myInputField’).val() }, function(replyData) { 1) Is the second argument of this

  • 0
$.post('somescript.php', { data: $('#myInputField').val() },
    function(replyData) {

1)
Is the second argument of this $.post method – in json?

OR

2)
Is the second argument of this $.post method a query string?

Thanks in advance,
MEM

Note: If this question doesn’t make sense, please, knowing why (it doesn’t make sense) may also help and, be taken as an valid answer as well.

  • 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-16T10:21:18+00:00Added an answer on May 16, 2026 at 10:21 am

    In general both ways are in practice very close. The function $.post or $.ajax will encode the data posted in the same way. If you want to post JSON data you should additionally encode the data value with some JSON encoder. See How do I build a JSON object to send to an AJAX WebService? as an example ($.post is a short form of $.ajax, so all which described with $.ajax and correct also for $.post)

    $.post('somescript.php', { data: JSON.stringify($('#myInputField').val()) }, ...);
    

    In the code above I use JSON.stringify from http://www.json.org/js.html.

    UPDATED: After your questions in the comment I hope I understand more which you want to know. So jQuery.post don’t makes any JSON encoding of data for you for and input parameters (the second parameter of jQuery.post). So it send the data always exactly in the same way. You can add additional “json” parameter (the last dataType parameter) to the $.post call, but this will not change how the data will be encoded.

    The question “should I send JSON data to the server or not?” is independent on $.post and you should answer on the question yourself depend on the requirement existing in your project. Sometime it is the question of the architecture of your solution. Sometime you have to choose one special way.

    In case of Microsoft ASMX Web Service for example there exist some important restriction. For example you want to deliver JSON data from the web service to be able to work easy with the data in JavaScript. So you want to have a method on the server side which have some input parameters and returns JSON as output. In case ASMX Web Service you must sent all input parameter to the web service method as JSON encoded data to be able to return JSON data from the web service, but ASMX Web Service decode/encode the data for you and you don’t need manually encode/decode JSON on the server side.

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

Sidebar

Ask A Question

Stats

  • Questions 492k
  • Answers 492k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think you can validate any data using form validation,… May 16, 2026 at 10:21 am
  • Editorial Team
    Editorial Team added an answer scaffolding is generated by a generator. Generators in general can… May 16, 2026 at 10:21 am
  • Editorial Team
    Editorial Team added an answer start here select * from information_schema.PARAMETERS where SPECIFIC_NAME = 'YourStoredProcedureName'… May 16, 2026 at 10:21 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

#post The names of my variables are not imporant! This code will be deleted
this is my first post.. so I'm learning Android & Java (coming from Actionscript),
Loosely related to this post , I need to get a list of all
Hello I want to post some data from silverlight to a website. I found
According to a post at the very end of this thread you can replace
I've heard that Firebug has Post Tab where the post data could be seen.
Hi this is my first post here hope you all are well. So Im
Post Update: I have tracked down the problem at the command ExecuteNonQuery. That's the
POST /upload HTTP/1.1 Host: assets.drop.io User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10)
Post your best solutions! You can find the full problem description and examples here:

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.