How does jquery implement ajax submission?
This article takes the implementation of ajax submission by jquery as an example to analyze the specific implementation of ajax submission. After reading the complete article, I believe you have some understanding of the implementation of ajax submission by jquery.
/ / you can only click once
Var can_click = true
Function Layui_edit () {
/ / data can be edited
$(".my _ edit") .each (function () {
$(this) .click (function () {
If (can_click) {
Can_click = false
Var goodsid = this.dataset.id
Console.log (goodsid)
/ / change to input box
Var text = $(this) .html ()
$(this) .html ('')
$(this) .children ("input"). Val ("). Focus (). Val (text)
/ / remove the cursor to restore the original $(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 ()
What is described above is the method that jquery implements ajax submission, and the specific usage needs to be used by everyone through hands-on experiments. If you want to know more about it, welcome to follow the industry information channel!