zoukankan      html  css  js  c++  java
  • jQuery Ajax实例参考

        //ajax请求数据

        var sendData = {
                        "action": "flightstop",
                        "flightno": _dataArray[0],
                        "s": _dataArray[1],
                        "e": _dataArray[2],
                        "sd": _dataArray[3],
                        "r": Math.random()
                    };
                   //设置30秒超时
                    var timeoutvalue = 30 * 1000;
                    $.ajax({
                        type: "get", //请求方式
                        dataType: "json",//请求数据类型
                        url: "SearchHandler",
                        data: sendData,//请求数据
                        timeout: timeoutvalue,//请求超时时间
                        success: function (data, status) {//请求成功处理方法
                            if (data.code == "0000") {
                                $("#" + _span_id).html("<font color='#0069ca'>经停:" + data.airport + "(" + data.arrivetime + "到达," + data.leavetime + "起飞)</font>");
                            }
                            else {
                                $("#" + _span_id).html("经停");
                            }
                        },
                        error: function () {//请求失败处理方法
                        }
                    });

  • 相关阅读:
    16. 3Sum Closest
    17. Letter Combinations of a Phone Number
    20. Valid Parentheses
    77. Combinations
    80. Remove Duplicates from Sorted Array II
    82. Remove Duplicates from Sorted List II
    88. Merge Sorted Array
    257. Binary Tree Paths
    225. Implement Stack using Queues
    113. Path Sum II
  • 原文地址:https://www.cnblogs.com/jinpn/p/4474998.html
Copyright © 2011-2022 走看看