zoukankan      html  css  js  c++  java
  • Ajax 异步请求

    window.onload = function() {
        var changGuanId = $("input[name='id']").val();
    
        if (changGuanId == undefined) {
            return;
        }
      
        $.ajax({
            type : "POST",
            url : ctxfront + "/exhi/flight?changGuanId=" + changGuanId,
            data : {
                "id" : changGuanId
            },
            success : function(data) {
                if (data != "") {// 有数据
                    var obj = eval(data.flight);
    
                    for (var i = 0; i < obj.length; i++) {
    
                        var symbol = '¥';// 钱符号
                        var refid = '96870';// 同程旅旅网提供的ID号
                        var li = "<li><a href='http://www.ly.com/iflight/FlightSearch.aspx?tt=0&orgDate=" + getdateTime() + "&orgCity=" + obj[i].takeoffCity + "&desCity=" + data.city
                                + "&refid=" + refid + "' target='_blank'><span class='locus mr_rt'><em>" + obj[i].takeoffCity + "</em>" + data.city
                                + "<i></i></span><span class='locus tate'><em>" + getBeforeDate(0) + "</em>" + getBeforeDate(30) + "<i></i></span><span class='ht_price'><s>" + symbol
                                + "</s>" + obj[i].salePrice + "</span></a></li>";
                        if (i < 2) {
                            $(flightLeftId).append(li);
                        } else {
                            $(flightrigthId).append(li);
                        }
                    }
                    $("#flightDiv").attr("style", "display:block;");
                } else {
                    $("#flightDiv").attr("style", "display:none;");
                }
    
            }
        });
    
    }
  • 相关阅读:
    MyBatis缓存
    MyBatis动态SQL
    MyBatis中#{}和${}的区别
    MyBatis映射配置文件详解
    MyBatis核心配置文件详解
    MyBatis动态代理
    KO ------- 表中字段名和实体类属性名不一致
    对实体类的CRUD操作
    MyBatis配置数据源的两种方式
    MyBatis入门
  • 原文地址:https://www.cnblogs.com/SHMILYHP/p/5122082.html
Copyright © 2011-2022 走看看