Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 996501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:53:08+00:00 2026-05-16T06:53:08+00:00

I am attempting to send a javascript array to my web server for an

  • 0

I am attempting to send a javascript array to my web server for an ajax request. Here is my code:

    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);
            } 
        });
    }

The array is being formed correctly, as when I hit the $.ajax() call Chrome’s developer tools show the tags object as being an array with 2 elements (all elements are just strings).

However, according to fiddler, the actual post parameters getting sent to the server are:

undefined=undefined

What am I doing wrong?

Edit
Console.Log shows:

console.log(tags)
["portability", "testing"]
undefined
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:53:09+00:00Added an answer on May 16, 2026 at 6:53 am

    What does a console.log(tags) say about the tags?

    Try sending it like this:

    data : ({tags : tags})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to write a Python function to send an email to a list
I'm attempting to send a list of records in response to an Ajax query.
I have a HTTP GET request that I am attempting to send. I tried
I am attempting to send Base64 image data via ajax to Server. Sometimes all
I'm attempting a basic AJAX call where I send the address 'www.google.com' to urlpost.php
I am attempting to store a list of commands to send down a serial
I'm attempting to put a php variable inside a javascript function and having no
I am attempting to send data to a server in a separate thread and
I'm attempting to send MMS implementing the method outlined here: How to send image
I'm attempting to send an image and some text to a server at the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.