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
Post a Comment