Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How does jquery implement ajax submission?

Shulou Source: shulou.com Published: 2022-06-03 07:21:35 11月23日 Update

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!

Tags: Mode above cursor content as is that is situation data method more industry information information channel channel analysis experiment input Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Redmi MariaDB Linux Microsoft