_self.del = function(obji) { _self.valuesLength--; var obji = $(obji).parent(); var value = obji.text(); if (_self.values == ',' + value + ',') { pizzalayer.msg({ msg: '标签不能全部删除', id: obji }) return; } _self.values = _self.values.replace(',' + value + ',', ','); var ajaxOption = { id: obji.parent(), success: function() { if (_self.valuesLength == 7) { obji.parent().append('<li><input type="text"></li>'); } obji.remove(); }, error: function() { _self.values = _self.values + value + ','; } }; _self.update(ajaxOption); }
error: function() { pizzalayer.msg({ 'msg': '更新失败,请稍后重试', 'id': ajaxOption.id, 'time': 2000 }); ajaxOption.error(); }
success: function(data) { if (data.state == 'true') { ajaxOption.success(); pizzalayer.msg({ 'msg': '更新成功', 'id': ajaxOption.id, 'time': 2000 }); } else { pizzalayer.msg({ 'msg': '更新失败,请稍后重试', 'id': ajaxOption.id, 'time': 2000 }); ajaxOption.error(); } },