Mainly relies on three buttons: new, delete, edit
Added: Create a new Li or tr when clicked and append to the parent, there is no need to mobilize the background interface (if the new need to pop the window input Val can be called);
Delete: Determine if this has a background passed the ID value, if not, then the new, can be directly deleted; If there is, you need to pass the ID value to the background, the background delete the record after the front end and then the Li to remove;
Ok (or edit): Gets the Val value of all input, judging: if there is no ID value, add to the array 1 and call the background add new interface, if there is an ID and Val changes (need to pre-save the original value and compare) then put into the array 2 call the Edit interface. Because the AJAX implementation of data transmission is asynchronous, so there is no guarantee that the new interface is finished to execute the editing interface, you can define a variable, the value of the sum of 2 arrays, loop once, variable--when the variable is 0 o'clock, represents the end of the data transfer.
Record the steps of the front-end AJAX implementation and deletion and modification functions