<%@ page isELIgnored="false"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.sunny.common.utils.StringUtil"%>
<%@ include file="/common/taglibs.inc"%>
<%@ page import="com.sunny.base.Convertutf"%>
<html>
<head>
<title>商品管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="/newver/js/jqueryAutocomplete/ui/jquery.ui.all.css">
<script src="/newver/js/jqueryAutocomplete/jquery-1.10.2.js"></script>
<script src="/newver/js/jqueryAutocomplete/ui/jquery.ui.core.js"></script>
<script src="/newver/js/jqueryAutocomplete/ui/jquery.ui.widget.js"></script>
<script src="/newver/js/jqueryAutocomplete/ui/jquery.ui.position.js"></script>
<script src="/newver/js/jqueryAutocomplete/ui/jquery.ui.menu.js"></script>
<script src="/newver/js/jqueryAutocomplete/ui/jquery.ui.autocomplete.js"></script> <link rel="stylesheet" href="/newver/js/jqueryAutocomplete/ui/demos.css"> <script type="text/javascript" language=javascript> $(function() {
function diseaseLabel( message ) {
$( "<div>" ).text( message ).prependTo( "#diseaseLabel" );
$( "#diseaseLabel" ).scrollTop( 0 );
} $( "#tags" ).autocomplete({
source: function( request, response ) {
$.ajax({
url: "merchandise!JibingList.html2",
dataType: "json",
data: {
name_startsWith: request.term
},
success: function( data ) {
response( $.map( data, function( item ) {
return {
label: item.name
}
}));
}
});
},
minLength: 2,
select: function( event, ui ) { // $("#diseaseLabel").val(ui.item.value); diseaseLabel( ui.item ?
"Selected: " + ui.item.value :
"Nothing selected, input was " + ui.item.value);
},
open: function() {
$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
},
close: function() {
$( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
}
});
}); </script>
</head>
<body> <div class="ui-widget">
<label for="city">Your city: </label>
<input id="city">
Powered by <a href="http://geonames.org">geonames.org</a>
</div> <div class="ui-widget" style="margin-top:2em; font-family:Arial">
Result:
<div id="diseaseLabel" style="height: 200px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
</div> </body>
</html>

jquery autocomplete插件结合ajax使用的更多相关文章

  1. Jquery autocomplete 插件示例

    通过Jquery autocomplete 插件动态传递输入参数完成自动完成提示: <%@ page language="java" import="java.ut ...

  2. [jQuery]jQuery DataTables插件自定义Ajax分页实现

    前言 昨天在博客园的博问上帮一位园友解决了一个问题,我觉得有必要记录一下,万一有人也遇上了呢. 问题描述 园友是做前端的,产品经理要求他使用jQuery DataTables插件显示一个列表,要实现分 ...

  3. jquery autocomplete插件

    jquery autocomplete插件 https://goodies.pixabay.com/jquery/auto-complete/demo.html autocomplete-table ...

  4. PHP结合jQuery.autocomplete插件实现输入自动完成提示的功能

    XHTML 首先将jquery库和相关ui插件,以及css导入.一共引用三个 jquery ,jquery_ui.js,jquery-ui.css 三个文件,不同版本小哥可能稍有差异(最后注意ajax ...

  5. 使用 jQuery Mockjax 插件模拟 Ajax 请求

    在实际的开发过程中,前端后台协商好了统一的接口,就各自开始自己的任务了.这时候我有这么一个 Ajax 请求需要从后台获取数据: $.ajax({ url: '/products/' }).done(f ...

  6. Jquery autocomplete插件的使用

    简单用法: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEnc ...

  7. jquery autoComplete 插件

    github: https://github.com/Pixabay/jQuery-autoComplete/blob/master/demo.html 官网demo https://goodies. ...

  8. Jquery autocomplete 插件使用

    轻松实现类似百度输入框联想功能: autocomplete 是一个很厉害的插件,该插件基于jquery,在jquery官网能下载到最新版本. 首先,jQuery UI 是基于 jQuery 的,所以, ...

  9. jquery autocomplete 插件的使用

    Autocomplete 自动完成 功能:输入框在输入关键字后,根据输入的内容给出相关的下拉框供用户选择,自动完成输入内容. 插件:使用jqueryUI的自动完成小部件,文档地址:https://jq ...

随机推荐

  1. android 定时器的实现

    在Android上常用的定时器有两种,一种是Java.util.Timer,一种就是系统的AlarmService了. 实验1:使用Java.util.Timer. 在onStart()创创建Time ...

  2. Activity使用Serializable传递对象实例

    public class SerializableBook implements Serializable { private static final long serialVersionUID = ...

  3. WPF/MVVM 快速开始指南(译)(转)

    WPF/MVVM 快速开始指南(译) 本篇文章是Barry Lapthorn创作的,感觉写得很好,翻译一下,做个纪念.由于英文水平实在太烂,所以翻译有错或者译得不好的地方请多指正.另外由于原文是针对W ...

  4. SU Demos 03T-F Analysis-03Suphasevel

    不足之处,欢迎批评指正. 1.先看readme,共有3个脚本. 第1个脚本用到的模型文件. 2.第1个脚本 运行结果 3.第2个脚本 4.第3个脚本

  5. LightOJ1157 LCS Revisited(DP)

    题目求两个字符串s1,s2不同的LCS个数. 经典的求LCS的DP是这样的: LCS[i][j]表示s1[0...i]和s2[0...j]的LCS LCS[i][j]从LCS[i-1][j-1]+1( ...

  6. BZOJ2725 : [Violet 6]故乡的梦

    如果S==T,那么答案为0. 如果S与T不连通,那么答案为inf. 否则,S到T的最短路径上至少有一条边. 求出以S为源点的最短路图,是个DAG,随便抓一条S到T的最短路,记为P. 设dpS[x]表示 ...

  7. 【BZOJ】3319: 黑白树(并查集+特殊的技巧/-树链剖分+线段树)

    http://www.lydsy.com/JudgeOnline/problem.php?id=3319 以为是模板题就复习了下hld............................. 然后n ...

  8. BJOI2015 Day1

    本以为会是三道小强与阿米巴,结果打开题目一看发现了这个: T1: 恩先写着一道 #include<cstdio> #include<cstring> #include<c ...

  9. BZOJ4143 [AMPPZ2014]The Lawyer

    Description Byteasar要制订m天的会议计划,一共有n场会议,第i场会议开始于第d[i]天的第a[i]秒,结束于第d[i]天的第b[i]秒. 对于每一天,请找出这一天的两场会议i,j, ...

  10. 微课程--Android--Android概述

    基本上是介绍了一下studio,然后模拟器,对studio的各部分功能有了大致了解 Android studio的文件结构 在Android模式的目录下有三个文件夹,其中Manifests中是配置文件 ...