Marc Rasmussen
Marc Rasmussen

Reputation: 20555

Ajax - illegal invocation error

I have the following function:

    function createSkillCard(attributeData,name)
{
    $.ajax({
        type: "POST",
        url: "/Skillcard/create",
        dataType: 'json',
        data:  {
            request: 'ajax',
            name: name,
            attributes: attributeData
        },
        success: function(data)
        {

        }
    })
}

The thing you need to know is that

attributeData 

Is an array of 4 items (strings)

name

is a string

However whenever i call this i get

Illegal invocation

error

what am i doing wrong?

Upvotes: 0

Views: 70

Answers (1)

Alnitak
Alnitak

Reputation: 339846

There's no standard serialisation using x-www-url-form-encoded for an array of strings.

Either use some additional serialisation (e.g. JSON) to convert the array into a string and then de

Upvotes: 1

Related Questions