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 967051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:15:19+00:00 2026-05-16T02:15:19+00:00

There are a whole bunch of tutorials out there explaining how to do this,

  • 0

There are a whole bunch of tutorials out there explaining how to do this, eg here and here.

Looks real easy huh? Yet I’ve still somehow managed to waste half a day on it without getting anything working.

Eg: the following works absolutely fine

public ActionResult FindStuff(string q)
{
    return Content("test");
}

$('#MyTextBox').autocomplete("MyController/FindStuff", {
    parse: function(data) {
        alert('parsing');
    }
});

If I change it to the following, absolutely nothing happens.

public JsonResult FindStuff(string q)
{
    return Json(new { name = "test" });
}

$('#MyTextBox').autocomplete("MyController/FindStuff", {
    dataType: 'json', // I've also tried with this line commented out
    parse: function(data) {
        alert('parsing');
    }
});

So it looks like the parse call is never being hit, i.e. I’m assuming the data load is blowing up somehow or thinks there is no data. Any ideas? Thanks.

p.s. it’s the Jorn Zaefferer plugin here.

  • 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-16T02:15:20+00:00Added an answer on May 16, 2026 at 2:15 am

    Make sure that you are returning an array and that you allow GET requests (in case your are using ASP.NET MVC 2.0):

    public ActionResult FindStuff(string q)
    {
        return Json(new[] { new { name = "test" } }, JsonRequestBehavior.AllowGet);
    }
    

    And then follow the examples:

    $('#MyTextBox').autocomplete("MyController/FindStuff", {
        dataType: 'json',
        parse: function (data) {
            var rows = new Array();
            for (var i = 0; i < data.length; i++) {
                rows[i] = { data: data[i], value: data[i].name };
            }
            return rows;
        },
        formatItem: function (row, i, n) {
            return row.name;
        }
    });
    

    Works nicely.

    Remark: FireBug helps diagnosing problems very quickly as it shows you exactly what AJAX requests are being sent and why they succeed or fail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been wondering this for quite some time. There are already a whole bunch
I've been wondering this for quite some time. There are already a whole bunch
I noticed that there's a whole bunch of different content types, some of them
There is a whole host of components that I am trying out to better
EDIT: There must be some way I can approach this without writing a whole
In the following function, there is the line: var username=getCookie(username); Here's the whole function:
I have an enum with a whole bunch of values (only three shown here):
I have a whole bunch of text. In between (random) there is something like
I have a click handler, which has event.preventDefault. There is whole lot of logic
Is there any way to read whole lines from a socket in Erlang, or

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.