jQuery自动完成说明 [英] jQuery autocomplete explanation

查看:65
本文介绍了jQuery自动完成说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是jQuery的新手,可以帮助我理解以下代码来自动完成吗?

Hi,

I am new to jQuery, can any one help me understand the below code to do auto complete?

$("#autocomplete").autocomplete({
                select: function(event, ui) {
                    $(this).val(ui.item.label);
                    __doPostBack($("input[id*=btn]").attr("id"), "OnClick")
                },
                source: function(request, response) {
                    response($.map(dataArray, function(item) {
                        if (item.label.indexOf($("#autocomplete").val()) == 0) {
                            return {
                                label: item.label,
                                value: item.value
                            }
                        }
                    }))
                },
                minLength: 1
            });




问候,
sajith




Regards,
sajith

推荐答案

(#autocomplete").autocomplete({ 选择:function(event,ui){
("#autocomplete").autocomplete({ select: function(event, ui) {


(this).val(ui.item.label); __doPostBack(
(this).val(ui.item.label); __doPostBack(


("input [id * = btn]").attr("id"),"OnClick") }, 来源:功能(请求,响应){ 响应(
("input[id*=btn]").attr("id"), "OnClick") }, source: function(request, response) { response(


这篇关于jQuery自动完成说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆