本文以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方式提交的方法,具體使用情況還需要大家自己動手實驗使用過才能領會。如果想了解更多相關內容,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。