Home >Web Front-end >JS Tutorial >Summary of methods for jquery to implement ajax form submission_jquery

Summary of methods for jquery to implement ajax form submission_jquery

WBOY
WBOYOriginal
2016-05-16 16:57:361162browse

方法一:

复制代码 代码如下:

function AddHandlingFeeToRefund()

        {
            var AjaxURL= "../OrderManagement/AjaxModifyOrderService.aspx";      
            alert($('#formAddHandlingFee').serialize());
                $.ajax({
                    type: "POST",
                    dataType: "html",
                    url: AjaxURL '?Action=' 'SubmitHandlingFee' '&OrderNumber=' $.trim($("#<%=this.txtOrderNumber.ClientID %>").val()),
                    data: $('#formAddHandlingFee').serialize(),
                    success: function (result) {
                        var strresult=result;
                        alert(strresult);
                        //加载最大可退金额
                        $("#spanMaxAmount").html(strresult);
                    },
                    error: function(data) {
                        alert("error:" data.responseText);
                     }

                });

        }


方法二:
复制代码 代码如下:
> // ajax to submit the form form alert($('#formAddHandlingFee').serialize());
                                                           html",
                                                                                                                     Action=' 'SubmitHandlingFee' '&OrderNumber=' $.trim($("#<%=this.txtOrderNumber.ClientID %>").val()),
      data: $('#formAddHandlingFee') .serialize(),
success: function (data) {
var strresult=data;
alert(strresult);
//Load the maximum refundable amount
).html(strresult);
                                                                                                                                       }

          });
       }

);


Page html code:


Copy code


The code is as follows:

                 

                   
                       
                           
                           
                       
                       
                           
                           
                       
                       
                           
                           
                       

                       
                           
                           

                       
                   

                               
                           

                               
                           

                               
                           

                               
                           

                               
                           

                               
                           

                           

                               
                               
                           

                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn