Not quite clear question. But still try to answer.
To send requests to the server from the client (browser) are used:
In order to display the answer to the request in the browser it is used:
- server programming in PHP or any other server language;
- or if you want to accept and process the received data on the client (in the browser), use the AJAX technology provided in the jQuery library
- or javascript language. Details: https://learn.javascript.ru/ajax
To convert a java script object on the client side to the JSON format and vice versa, the following methods are used:
- JSON.parse - reads objects from a string in JSON format.
- JSON.stringify - turns objects into a string in JSON format, used when you need to transfer data via JavaScript over a network.
More details: https://learn.javascript.ru/json
- To convert a JSON object to a PHP variable and vice versa, the following functions are used on the server side:
- json_decode - Decodes a JSON string
- json_encode - Returns the JSON representation of the data.
More details: http://php.net/manual/ru/ref.json.php