• 路政整理


    下拉选择框取得选中的值

    <select class="text" onchange="selectPrint()" id="">
        <option value="">请选择高速</option>
    </select>
    var indexx = document.getElementById("typesize").selectedIndex;
    var textx = $('#typesize').find('option').eq(indexx).attr("value");

    循环输出数据

    for(var i=0;i<data.length;i++){
    	out += "<option value=""+data[i].id+"|"+data[i].station+"">"+data[i].name+"</option>";
    }
    

    将数据转为json

    var data = JSON.parse(response);
    $.ajax({
        url: '/index.php/public/road/price/cartype/'+textx+'/start/'+text1+'/end/'+text2,
        type: 'GET',
        success: function(response){
            $("#mask,#loader").hide();
            var data = JSON.parse(response);
            $('#dis').html(data.pathLen+" 公里");
            $('#price').html(data.fee+" 元");
        },
        error: function(data) {
            $("#mask,#loader").hide();
            $('#w3').html('没有查到通行费记录').css('display','block');
        }
    });
  • 相关阅读:
    MyBatis 自动关闭 session
    Sublime相关操作及配置
    CentOS yum换源并配置SSH
    SpringSecurity认证流程
    ES模块化的导入和导出
    Promise学习
    axios的使用
    SpringSecurity注解的使用
    Webpack笔记
    JAVA工具类
  • 原文地址:https://www.cnblogs.com/wallaceyuan/p/4147151.html
Copyright © 2020-2023  润新知