//获取全部 function getTagAll(){ $.ajax({ type : "post", url : "../../easyAPI/tag/getTag.action", contentType : "application/json;charset=utf-8", success : function(data) { showTags(data); }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("获取标签信息失败!"); } }); } //根据id删除 function deleteTagById(tagId){ $.ajax({ type : "post", url : "../../easyAPI/tag/delete.action", data : "tagId="+tagId, success : function(data) { if (data == 1) { clearTags(); getTagAll(); }else{ console.log("删除标签失败!"); }; }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("删除标签失败!"); } }); } //插入标签 function insertTag(obj){ var args = JSON.stringify(obj); $.ajax({ type : "post", url : "../../easyAPI/tag/insert.action", data : args, contentType : "application/json;charset=utf-8", success : function(data) { if(data == 1){ getTagAll(); }else{ console.log("保存失败!"); } }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("ajax请求失败!"); } }); }