通过Jquery autocomplete 插件动态传递输入参数完成自动完成提示:

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.wlyd.wmscloud.util.ehcache.EhcacheUtil"%>
<%@page import="com.wlyd.wmscloud.persistence.beans.EsUser"%>
<%@page import="com.wlyd.wmscloud.util.finals.Const"%>
<%
String staticUrl = (String) EhcacheUtil.get("staticUrl");
String webRoot = request.getContextPath();
EsUser user = (EsUser) session.getAttribute(Const.SESSION_BACK_USER);
String operateType=(String)request.getParameter("opt");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>JQuery自动补全插件</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="http://jqueryui.com/autocomplete/resources/demos/style.css">
</head>
<script type="text/javascript">
function back()
{
window.location.href="<%=webRoot%>"+"/pda/index.html";
}
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
]; $( "#wmofBatchno" ).autocomplete({
source : function(request, response){
var url="http://www.runoob.com/try/try.php?filename=try_ng_scope_sync&res="+ Math.random();
$.ajax({
url: url,
dataType: "json",
data: {
wmofBatchno: request.term,
},
success: function( data ) {
// 模拟返回的数据
response( availableTags );
}
});
}
});
});
</script>
<body>
<div class="title">商品批次号自动补全</div>
<div class="searchbox">
<ul>
<li><input type="button" value="返回" class="btn" onclick="back()" /></li>
<li><em>商品批次号:</em><span><input type="text" class="txt" id="wmofBatchno" name="wmofBatchno" value=""/></span>
</ul>
</div>
</body>
</html>

Jquery autocomplete 插件示例的更多相关文章

  1. jquery autocomplete插件

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

  2. Jquery autocomplete插件的使用

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

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

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

  4. jquery autoComplete 插件

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

  5. Jquery autocomplete 插件使用

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

  6. jquery autocomplete 插件的使用

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

  7. jquery autocomplete插件结合ajax使用

    <%@ page isELIgnored="false"%> <%@ page contentType="text/html; charset=UTF- ...

  8. 使用jQuery Autocomplete(自动完成)插件

    jQuery 的Autocomplete(自动完成.自动填充)插件有不少,但比较下来我感觉,还是bassistance.de 的比较强大,我们就来写一些代码感受一下. 最简单的Autocomplete ...

  9. [Jquery] Jquery AutoComplete的使用方法实例

    jQuery的Autocomplete(自动完成.自动填充)插件 jquery-autocomplete配置: <script type="text/javascript" ...

随机推荐

  1. 黑马程序员_Java面向对象_异常

    6.异常 1.异常: 就是程序在运行时出现不正常的情况.问题也是现实生活中一个具体的事物,也可以通过Java的类进行描述,并封装成对象.Exception和Error的子类名都是以父类名作为后缀名. ...

  2. [置顶] Oracle 11g R2 ASM:了解 Oracle ASM 基本概念

    About Oracle ASM Instances About Oracle ASM Disk Groups About Mirroring and Failure Groups About Ora ...

  3. Ext中窗体第二次点击报错或者其内控件不显示的问题,弄了2天才解决,记录下

    registerPanel.js: registerPanel = new Ext.form.FormPanel({ id:'registerPanel', layout:'form', autoHe ...

  4. Spring 小示例

    通过一个简单的示例来初步理解Spring框架 1.创建java工程,导入相应Spring包,放在lib文件夹中 2.接口  IHelloMessage package com.jike.spring. ...

  5. windows 查看端口被占用

    C:\Users\xxxx> 根据端口找到进程14716 C:\Users\xxxx>tasklist|findstr "14716"node.exe 14716 Co ...

  6. python标准库之字符编码详解

    codesc官方地址:https://docs.python.org/2/library/codecs.html 相关帮助:http://www.cnblogs.com/huxi/archive/20 ...

  7. hdu4126Genghis Khan the ConquerorGenghis Khan the Conqueror(MST+树形DP)

    题目请戳这里 题目大意:给n个点,m条边,每条边权值c,现在要使这n个点连通.现在已知某条边要发生突变,再给q个三元组,每个三元组(a,b,c),(a,b)表示图中可能发生突变的边,该边一定是图中的边 ...

  8. Android 自定义UI--指南针

    有了之前的基础,下面开始实现一个简单的指南针.首先来看一下效果图, 我们可以粗略将这个指南针分为三个部分,一是圆形背景,二是刻度,三是文本.那么在写代码的时候,就可以声明三个Paint画笔来画以上三个 ...

  9. jQuery.extend 和 jQuery.fn.extend

    1.jQuery.extend 我们先把jQuery看成了一个类,这样好理解一些.jQuery.extend(),是扩展的jQuery这个类. 假设我们把jQuery这个类看成是人类,能吃饭能喝水能跑 ...

  10. C#的位运算符

    C#的位运算符&,| ,^ ,<<,>>2008年08月01日 星期五 15:52位 运 算我们知道任何信息在计算机中都是以二进制的形式保存的位操作符就是对数据按二进制 ...