天下之事,必先处之难,而后易之。
君临
知我者谓我心忧,不知我者谓我何求

通过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>

 

posted on 2016-02-25 15:53  boonya  阅读(365)  评论(0编辑  收藏  举报

我有佳人隔窗而居,今有伊人明月之畔。
轻歌柔情冰壶之浣,涓涓清流梦入云端。
美人如娇温雅悠婉,目遇赏阅适而自欣。
百草层叠疏而有致,此情此思怀彼佳人。
念所思之唯心叩之,踽踽彳亍寤寐思之。
行云如风逝而复归,佳人一去莫知可回?
深闺冷瘦独自徘徊,处处明灯影还如只。
推窗见月疑是归人,阑珊灯火托手思忖。
庐居闲客而好品茗,斟茶徐徐漫漫生烟。

我有佳人在水之畔,瓮载渔舟浣纱归还。
明月相照月色还低,浅近芦苇深深如钿。
庐山秋月如美人衣,画堂春阁香气靡靡。
秋意幽笃残粉摇曳,轻轻如诉画中蝴蝶。
泾水潺潺取尔浇园,暮色黄昏如沐佳人。
青丝撩弄长裙翩翩,彩蝶飞舞执子手腕。
香带丝缕缓缓在肩,柔美体肤寸寸爱怜。
如水之殇美玉成欢,我有佳人清新如兰。
伊人在水我在一边,远远相望不可亵玩。