x-editable简单使用
<a href="javascript:;" id="username" data-pk="2257">
示例文字
</a>
<script type="text/javascript">
$(function() {
//editables
$('#username').editable({
url: 'https://www.baidu.com/',
type: 'text',//编辑框的类型。支持text|textarea|select|date|checklist等
name: 'username',
title: '修改',//编辑框的标题
mode: "inline",//编辑框的模式:支持popup和inline两种模式,默认是popup
validate:function (value) {
//字段验证
if(value == 1){
return '值不能等于1';
}
},
success: function(value) {
//
alert('接收返回');
}
});
});
</script>
具体demo下载:https://download.csdn.net/download/code_pupil/11159901
详细使用可参考文章