How to send data to json file using jquery/ajax

前端 未结 2 998
迷失自我
迷失自我 2021-01-07 06:13

I have found countless tutorials on how to retrieve data from json files using jQuery and ajax but none on how to POST data to a json file. If some one coul

2条回答
  •  温柔的废话
    2021-01-07 07:14

    It was a bit unclear ...
    client side languages are not able to write or edit something on the server
    via AJAX (with or without jQuery) you are only able to read data or send them
    so you can pass your data to a php file then execute what you want to do , by php.
    here is a tutorial for working with files in php
    http://www.w3schools.com/php/php_file_open.asp
    and here is another one for getting passed data by AJAX in php file
    http://www.w3schools.com/php/php_superglobals.asp
    look at $_GET , $_POST , $_REQUEST
    good luck

提交回复
热议问题