【问题标题】:jquery Tagit plugin not working finejquery Tagit插件无法正常工作
【发布时间】:2013-08-30 12:42:02
【问题描述】:

我正在尝试在我的 .net 应用程序中实现 jquery tag it plugin version v2.0。自动完成仅显示单个字符,例如“C”,它在所有字符串中重复的类型数。这是我正在使用的代码。请建议如何解决?

 $(function () {
        $('[id$=txthobbies]').keyup(function () {
            $.ajax({
                type: "POST",
                url: "EditProfile.aspx/GetHobbies",
                data: "{SearchStr:'" + $('[id$=txthobbies]').val() + "'}",
                dataType: 'json',
                async: false,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                   $('[id$=txthobbies]').tagit({
                       availableTags: data.d,
                        select: true,
                        sortable: true,
                       triggerKeys: ['enter', 'comma', 'tab']
                    });
                }
            });

        });
    });

【问题讨论】:

  • data: "{SearchStr:'" + $('[id$=txthobbies]').val() + "'}",, async: false, 为什么哦为什么 - 另外,您使用的是哪个 tagit 插件?有两个不同的同名。

标签: jquery jquery-plugins tag-it


【解决方案1】:

做了很多工作后终于解决了问题。我正在尝试传递对象数组插件只接受 JSON 字符串。

【讨论】:

    猜你喜欢
    • 2012-05-28
    • 2011-07-28
    • 2018-04-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多