zoukankan      html  css  js  c++  java
  • ajax

    1.ajax异步

    有参数

     1)form表单

      $.ajax({
                                url: "Handle/OrderData.ashx?action=ScanCodeConfirm",  //一般处理程序
                                type: "post",
                                data: $("#form1").serialize() ,   //传递的数据
                                dataType: "json",   //数据类型json
                                success: function (data) {    //成功执行
                                    if (data.success) {


                                    }
                                    else {
                               
                                    }
                                }
                            });

    2)拼接

     $.ajax({
                                url: "Handle/OrderData.ashx?action=ScanCodeConfirm",
                                type: "post",
                                data: $("#form1").serialize() + "&g_pieces=" + g_pieces + "&g_length=" + g_length,
                                dataType: "json",
                                success: function (data) {
                                    if (data.success) {

                                     
                                    }
                                    else {
                                     
                                    }
                                }
                            });

    3) 

    $.ajax({
                    url: "/Handle/OrderData.ashx?action=RecSendUserInfo",
                    type: "post",
                    data:{countryID:countryID},
                    dataType: "json",
                    success: function (data) {
                        if (data.success) {
                        
                        }
                        else {
                        }
                    }
                });

    2.无参数

     function rec_iinfo()
            {
                $.ajax({
                    url: "Handle/OrderData.ashx?action=getRec",
                    type: "post",
                    dataType: "json",
                    success: function (data) {
                        if (data.success) {
                          
                        }
                    }
                });
            }

     详见:http://www.w3school.com.cn/jquery/ajax_ajax.asp

  • 相关阅读:
    Linux学习之网络基础
    C# 随笔
    最牛B的编码套路
    c++ Primer 第七章不熟悉知识点总结
    oracle求表的倒数二行数据
    c++ Primer 第六章不熟悉知识点总结
    c++ Primer 第五章不熟悉知识点总结
    c++ Primer 第四章不熟悉知识点总结
    c++ Primer 第三章不熟悉知识点总结
    骑驴找马
  • 原文地址:https://www.cnblogs.com/1955/p/7928223.html
Copyright © 2011-2022 走看看