/** * Created by vian on 2017/3/27. */ var mainAjax = { getStdBillsLib: function(){ $.ajax({ type: "post", url: "/stdBillsEditor/getStdBillsLib", data: {"data": JSON.stringify({"userId": userId})}, dataType: "json", success: function(result){ if(result.data){ for(var i=0; i"+billsLibName+""+createDate+" " + " " + ""); } } } }); }, createStdBillsLib: function(billsLibName){ $.ajax({ type: "POST", url: "/stdBillsEditor/createStdBillsLib", //data: {"data": JSON.stringify({"name": billsLibName, "createDate": "no!"}) }, data: {"name": billsLibName, "createDate": "no!"}, dataType: "json", cache: false, timeout: 50000, success: function(result){ alert("success!"); }, error: function(jqXHR, textStatus, errorThrown){ alert('error ' + textStatus + " " + errorThrown); } }); }, deleteStdBillsLib: function(billsLibId){ $.ajax({ type: "POST", url: "/stdBillsEditor/deleteStdBillsLib", data: {"data": JSON.stringify({"billsLibId": billsLibId})}, dataType: "json", success: function(result){ if(!result.error){ var jqId = "#"+billsLibId; $(jqId).remove(); } } }); } }