首页 新闻 会员 周边

jquery ui autocomplete问题

0
悬赏园豆:10 [已解决问题] 解决于 2012-11-10 09:47
        $("#txtOnline1").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: $.cookie('xmlHost') + "customer/" + $.cookie('Login_cust_id') + "/vehicle/search",
                    dataType: "get",
                    data: { auth_code: $.cookie('Login_auth_code'), tree_path: $.cookie('Login_tree_path'), mode: "all", limit: 5, key: request.term },
                    success: function (data) {
                        var json = JSON.parse(data);
                        var _resObj = $.map(json, function (item) {
                            return { label: item.obj_name, value: item.obj_id }
                        });
                        alert(_resObj);
                        response(_resObj);
                    },
                    complete: function () {
                        alert(arguments[0]);
                    }
                });
            },
            minLength: 2,
            select: function (event, ui) {
                log(ui.item ? "Selected: " + ui.item.label : "Nothing selected, input was " + this.value);
            },
            open: function () {
                $(this).removeClass("ui-corner-all").addClass("ui-corner-top");
            },
            close: function () {
                $(this).removeClass("ui-corner-top").addClass("ui-corner-all");
            }
        });

请求地址 返回数据

为什么获取到了数据处理还是不行 js又不报错

s_p的主页 s_p | 初学一级 | 园豆:138
提问于:2012-11-06 17:54
< >
分享
最佳答案
0

应该是获取到的数据,转换成JSON来处理,没有任何的效果?

收获园豆:10
chenping2008 | 大侠五级 |园豆:9836 | 2012-11-06 21:28

恩 明白了 谢谢

s_p | 园豆:138 (初学一级) | 2012-11-10 09:47
其他回答(1)
0
 dataType: "POST",
Mundo Novo | 园豆:69 (初学一级) | 2012-11-07 08:59
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册