温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

jquery如何实现ajax方式提交?

发布时间:2020-06-01 14:00:05 来源:亿速云 阅读:263 作者:Leah 栏目:软件技术

本文以jquery实现ajax方式提交为例,为大家分析ajax提交方式的具体实现,阅读完整文相信大家对jquery实现ajax方式提交有了一定的认识。

//只能点击一次
var can_click = true;
function Layui_edit(){
//数据可编辑
$(".My_edit").each(function(){
$(this).click(function () {
if(can_click) {
can_click = false;
var goodsid =this.dataset.id;
console.log(goodsid)
//变为输入框
var text = $(this).html();
$(this).html('<input type="text" class="layui-input layui-table-edit" value="' + text + '">');
$(this).children("input").val("").focus().val(text);


 //移除光标 恢复原样
                $(this).find(".layui-table-edit").blur(function () {
                    // console.log($(this));
                    var data = $(this).val();
                    $(this).parent().html(data);
                    $(this).remove();
                    can_click = true;

                    ajax_("admin/Bankgoods/updatebankpoints", {id: goodsid,bankpoints:data}, function (r) {
                        success_res(r);
                    })
                })
            }
        })
    })

}
Layui_edit();         

上文描述的就是jquery实现ajax方式提交的方法,具体使用情况还需要大家自己动手实验使用过才能领会。如果想了解更多相关内容,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI