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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:55:29+00:00 2026-05-23T11:55:29+00:00

Got a simple autocomplete box (jquery ui) that gets its source from a web

  • 0

Got a simple autocomplete box (jquery ui) that gets its source from a web service. The code is something like below:

var autocompleteOptions = {
    source = getDataFromService,
    minLength: 3
};

var getDataFromService = function(request, response) {
    var ajaxOptions = {
        url: "http://myservice:1234/somedata/",
        dataType: "jsonp",
        data: "someVariable = " + request.term,
        success: function(data) { alert("data"); },
        error: function(xhr, description, error) { alert("failed"); }
    };

    $.ajax(ajaxOptions);
}

$(someSelector).autocomplete(autocompleteOptions);

Looking in fiddler and even in the Firefox firebug panel, I can see that the JSON is correctly returned, and the server response is a 200. I have even checked the created jsonp script snippet, which also contains the correct JSON. However it always hits the error function not the success one.

I have also tried using complete and getting the data from the xhr manually, however the responseText and responseXml are both undefined. The error contained says parse error, but it all seems to be syntactically correct json, as the firebug panel and fiddler both display it fine.

HTTP/1.1 200 OK
Server: ASP.NET Development Server/9.0.0.0
Date: 28 Jun 2011 11:17:04 GMT
X-AspNet-Version: 2.0.50727
X-AspNetMvc-Version: 2.0
Cache-Control: private
Content-Type: application/json; charset=utf-8
Content-Length: 29
Connection: Close

[{"id":"1", "somevar":"hello"}]
  • 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-23T11:55:30+00:00Added an answer on May 23, 2026 at 11:55 am

    That JSON is not correct,

    [{"id":"1", somevar:"hello"}]

    needs to be

    [{"id":"1", "somevar":"hello"}]

    JSON requires double quotes.

    http://jsfiddle.net/robert/Y6ypV/

    A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.

    Take From: http://www.json.org/

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

Sidebar

Related Questions

I've got a simple asmx web service that just needs to log some information
I've got a simple java class that looks something like this: public class Skin
I've got a simple class that inherits from Collection and adds a couple of
I've got a simple application that shows pictures dragged onto it. I'd like the
I've got simple java-based ppt->swf sub-project that basically works. The open source software out
I'm using jquery-ui autocomplete to validate some form inputs. I've got this code :
I got this simple function in jquery/javascript that wont work in IE7, IE8: $(input[type='checkbox'],
I've got a simple function like this: function CreateFileLink() { global $Username; return date(d-m-y-g-i);
I've got a simple WPFToolkit DataGrid : <Grid> <dg:DataGrid Name=theDataGrid/> </Grid> And in code
Hi I've got a simple question. I've this code below, i use ajax three

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.