Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does jquery implement ajax submission?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report