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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:59:54+00:00 2026-05-24T10:59:54+00:00

I want to return a JSON object using a classic ASP script (it’s part

  • 0

I want to return a JSON object using a classic ASP script (it’s part of an AJAX request).

If I just send the reponse as text like:

response.write("{ query:'Li', suggestions:['Liberia','Libyan Arab Jamahiriya','Liechtenstein','Lithuania'], data:['LR','LY','LI','LT'] }")

will this work, or do I actually need a JSON library?

Edit: I’m trying to get the autocomplete plugin at http://www.devbridge.com/projects/autocomplete/jquery/#howto to work.

javascript:

 $(document).ready(function() {
    var a = $('#txtValue').autocomplete({ 
    serviceUrl:'script.asp',
    minChars:2, 
    maxHeight:400,
    width:300,
    zIndex: 9999,
    deferRequestBy: 0, //miliseconds
    onSelect: function(value, data){ alert('You selected: ' + value + ', ' + data); },
});

ASP:

<% 
response.ContentType = "application/json"
response.write("{ query:'Li', suggestions:['Liberia','Libyan Arab Jamahiriya','Liechtenstein','Lithuania'], data:['LR','LY','LI','LT'] }") 
%>

Autocomplete is not working. It works if I use a local lookup array like
lookup: [‘January’, ‘February’, ‘March’, ‘April’, ‘May’]

But there’s something wrong with the ajax meaning it doesn’t return the list properly.

  • 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-24T10:59:56+00:00Added an answer on May 24, 2026 at 10:59 am

    It appears to be a parsing error on the client side.

    I didn’t think this would make a difference, but it looks like if you quote everything, including the property names, it seems to work. And use double-quotes instead of single quotes – that apparently is making a difference.

    Remember to double your double-quotes (at least I think that’s how you do it in VBScript – been a long time).

    So:

    <%
        Response.ContentType = "application/json"
        Response.Write("{ ""query"":""Li"", ""suggestions"":[""Liberia"",""Libyan Arab Jamahiriya"",""Liechtenstein"",""Lithuania""], ""data"":[""LR"",""LY"",""LI"",""LT""] }")
    %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just simply want to return a JSON object (using ajax) from my server
I have a ASP.NET web service decorated with System.Web.Script.Services.ScriptService() so it can return json
I want to deserialize a JSON object (using GSON, because I already use it
I want to return back html inside my json object however this does not
I want to return the Model (data) of a controller in different formats (JavaScript/XML/JSON/HTML)
I want to return a private field from a remoted object but i get
I want to return some files in a HttpResponse and I'm using the following
I am using asp.net mvc with jquery... I have made a json call to
I am making a sequence of Ajax calls using the Ext.Direct module. I want
I'm having a problem with jQuery/Ajax/JSON. I'm using a jQuery ajax post like so...

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.