专注于JQuery中的AutoComplete不工作? [英] Focus on AutoComplete in JQuery Not working ?

查看:59
本文介绍了专注于JQuery中的AutoComplete不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请任何机构可以查看下面的代码,这是行不通的





Please Any Body can check below code, this is not working


<script type="text/javascript" language="javascript">
        $(function () {
            $('#<%=txtKeyWord.ClientID %>').autocomplete({
                source: function (request, response) {
                    $.ajax({
                        url: "WebService.asmx/spGetKeyword",
                        data: "{ 'keyword': '" + request.term + "' }",
                        type: "POST",
                        dataType: "json",
                        contentType: "application/json;charset=utf-8",
                        success: function (result) {
                            response(result.d);
                        },
                        error: function (result) {
                            alert('There is a problem processing your request');
                        }
                    });
                },
                minLength: 0,
                focus: function () {
                    $.ajax({
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        data: "{ Iid: '" + $('#<%=txtItemCode.ClientID %>').val() + "'}",
                        url: "WebService.asmx/GetNameFromService",
                        dataType: "json",
                        success: function (data) {
                            $('#<%=txtKeyWord.ClientID %>').val(data.d);
                        }
                    });

                }
            });
        });

    </script>



帮帮我如果有人知道

谢谢

Bajid

推荐答案

(function(){
(function () {


('#<% = txtKeyWord.ClientID %> ')。autocomplete({
source:function(request,request,响应){
('#<%=txtKeyWord.ClientID %>').autocomplete({ source: function (request, response) {


.ajax({
url:WebService.asmx / spGetKeyword,
data:{'keyword':'+ request.term +'},
类型:POST,
dataType:json,
contentType:application / json; charset = utf-8,
成功: function(result){
response(result.d);
},
错误:函数(结果){
alert('处理您的请求时出现问题');
}
});
},
minLength:0,
焦点:function(){
.ajax({ url: "WebService.asmx/spGetKeyword", data: "{ 'keyword': '" + request.term + "' }", type: "POST", dataType: "json", contentType: "application/json;charset=utf-8", success: function (result) { response(result.d); }, error: function (result) { alert('There is a problem processing your request'); } }); }, minLength: 0, focus: function () {


这篇关于专注于JQuery中的AutoComplete不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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