为什么Jquery发送"undefined = undefined"作为我的post参数而不是发送数组数据?

Kal*_*exx 6 arrays ajax jquery

我正在尝试将javascript数组发送到我的Web服务器以获取ajax请求.这是我的代码:

    function SearchTasksByTags() {
        // Get the list of tags currently chosen
        var tags = [];
        $('.tagit-choice input').each(function () { tags.push($(this).val()); });

        // If we have no tags, don't bother searching and just clear the current results
        if (tags.length == 0) {
            $('#tagSearchResults').empty();
            return;
        }

        // Retrieve the search results from the server
        $.ajax({ url: '<%= Url.Action("SearchByTags") %>',
            data: tags,
            type: 'POST',
            success: function (html) {
                $("#tagSearchResults").empty().append(html);
            } 
        });
    }
Run Code Online (Sandbox Code Playgroud)

阵列正在形成正确,因为当我点击$.ajax()调用时Chrome的开发人员工具将标签对象显示为具有2个元素的数组(所有元素都只是字符串).

但是,根据fiddler的说法,发送到服务器的实际帖子参数是:

undefined=undefined
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

编辑 Console.Log显示:

console.log(tags)
["portability", "testing"]
undefined
Run Code Online (Sandbox Code Playgroud)

Rak*_*ard 9

什么是一个的console.log(标签)说的标签?

尝试像这样发送:

data : ({tags : tags})
Run Code Online (Sandbox Code Playgroud)