-
Notifications
You must be signed in to change notification settings - Fork 8
FAQ's
Creating a rest based app requires you to send data to your server in json or xml (most likely). Well you know when the data is huge on the client side you tend to create the json yourself most of the time by writing a lot of boiler plate code. What if you just had to tweak in your html and the hierarchical json with the values would be created magically for you. Interesting ?
So basically diver does all that for you.
Well you place a name attribute on your input fields (be it any field and yes it can be an header or p tag as well) and diver will smartly pull out the value from it and put it inside the root of the output json.
<input type="text" name="first_name">
gets dumped as
{
"first_name": "john doe"
}
Diver let's you define a group attribute in your html in which you specify the position of the key in the output json.
<input type="text" name="first_name" group="personal_details">
gets dumped as
{
"personal_details":{
"first_name": "john doe"
}
}
Jump to the Examples wiki for more info.