javascript - Why JSON Object Serialization is needed or important sending in ajax call to the server? -


i have seen @ several places developers using json.stringify(data) while making ajax call server serialization of post data in json string, why needed ?

$.ajax({     url: url,     type: "post",     data: json.stringify(data),     contenttype: "application/json",     complete: callback }); 

several modern frameworks capable directly bind json data structures model businesses, allows incredibly fast , easy relationship between client , server data models.

this way can work feely on client side js objects, on moment send data server via ajax, stringify these objects allow server end understand them, , in automatic way server able translate info server data classes, without further interaction needed (of course, need defined classes compatible client model data structures).


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -