zoukankan      html  css  js  c++  java
  • 自动补全功能

    引用<script src="autocomplete.js"  type="text/javascript"></script>

        <link href="jquery-ui.css" rel="stylesheet" />

    function dizixlsj() {
    layer.msg("1111");
    var khjc = $("#ContentPlaceHolder1_khjc").val();
    $.ajax({
    type: "POST",
    dataType: "json",
    async: false,
    url: 'ashx/TransportationFeeHandler.ashx',
    data: {
    ope: "dezhixlsj",
    khjc:khjc
    },
    beforeSend: function () {
    //$("#seltable").showLoading();
    },
    success: function (data) {
    var songhuodizi = new Array();
    var tihuodizi = new Array();
    for (var i = 0; i < data.length; i++) {
    tihuodizi[i] = $.trim(data[i].起始地);
    songhuodizi[i] = $.trim(data[i].目的地);
    }
    var songhuodizi = QuChong(songhuodizi);
    var tihuodizi = QuChong(tihuodizi);
    $("#qsd1").autocomplete({
    source: tihuodizi
    });
    $("#mdd1").autocomplete({
    source: songhuodizi
    });
    //$("#seltable").hideLoading();
    }
    });
    }

    //数组去重
    function QuChong(Array) {
    var res = [];
    var json = {};
    for (var i = 0; i < Array.length; i++) {
    if (!json[Array[i]]) {
    res.push(Array[i]);
    json[Array[i]] = 1;
    }
    }
    return res;
    }

  • 相关阅读:
    struts2_maven_learning
    test_maven_实现表单验证
    Struts2_learning
    计算机信息安全技术_学习
    SQL_sql语言的学习
    ios视图加载时所涉及到的事件
    ios 判断版本更新
    ios 裁剪图片(1裁多)
    iOS 设置与配置
    ios Auto Layout中Stack View的使用
  • 原文地址:https://www.cnblogs.com/ykgbk/p/8966674.html
Copyright © 2011-2022 走看看