来自webserive的自动完成数据 [英] autocomplete data from webserive

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

问题描述

大家好,我创建了一个小型应用程序,在我的应用程序中有文本框,我将使用托管在我的PC中的Web服务将数据填充到文本框中,
我正在使用Java脚本代码进行自动完成过程,以下是我的代码

hi everyone, i have created small application, in my application i have text box, i ll fill the data to the text box by using web service which is in my hosted my PC,
i am using java script code for the auto complete process, below is my code,

$.ajax({
                type: "POST",
                url: "http://localhost/kff/n_kff.asmx/getitem",
                dataType: "json",
                data: "{}",
                contentType: "application/json; charset=utf-8",
                success: function(data) {
                    var datafromServer = data.d.split(":");
                    $("[id$='txtautofromDB']").autocomplete({
                        source: datafromServer
                    });
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert(textStatus);
                }
            });





这是我在带有Web服务的文本框中自动完成代码,但是上面的代码不起作用,请告诉我我想对上面的代码做哪些更改,您的帮助将对我非常有用.





this is my code for autocomplete in text box with web service, but the above code is not working , please tell me what changes should i want to do in the above code,, your help will be great-full to me

推荐答案

.ajax({ 类型:" , url:" , dataType:" , 数据:" , contentType:" , 成功:功能(数据){ var datafromServer = data.d.split(" );
.ajax({ type: "POST", url: "http://localhost/kff/n_kff.asmx/getitem", dataType: "json", data: "{}", contentType: "application/json; charset=utf-8", success: function(data) { var datafromServer = data.d.split(":");


("
("[id


='txtautofromDB']").autocomplete({ 来源:datafromServer }); }, 错误:函数(XMLHttpRequest,textStatus,errorThrown){ alert(textStatus); } });
='txtautofromDB']").autocomplete({ source: datafromServer }); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); } });





这是我在带有Web服务的文本框中自动完成代码,但是上面的代码无法正常工作,请告诉我我想对上面的代码做哪些更改,您的帮助对我将非常有用





this is my code for autocomplete in text box with web service, but the above code is not working , please tell me what changes should i want to do in the above code,, your help will be great-full to me


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

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