Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2015
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Help writting a JSON to server

    Hi,

    I'm looking for help on a JSON question. The server only accepts POST data in a JSON format and i want to submit data but i don't know how is it possible in html or javascript.

    Thanks

  2. #2
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    West Des Moines, Iowa
    Posts
    8,104
    Thanks
    37
    Thanked 1,086 Times in 1,082 Posts
    javascript gets the information from html. Jason is like an array. It's a series of data pairs. It might look like this:
    var obj = { "fname":"John", "lname":"Smith", "age":30, "city":"New York"};
    and send "obj".
    You just send this using AJAX

    Also you might need to use
    var myJSON = JSON.stringify(obj);
    and send "myJSON".
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •