title: How to return a JSON object in classic ASP
body: <p>I want to return a JSON object using a classic ASP script (it's part of an AJAX request).</p>
  
  <p>If I just send the reponse as text like:</p>
  
  <pre><code>response.write("{ query:'Li', suggestions:['Liberia','Libyan Arab Jamahiriya','Liechtenstein','Lithuania'], data:['LR','LY','LI','LT'] }")
  </code></pre>
  
  <p>will this work, or do I actually need a JSON library?</p>
  
  <p><strong>Edit:</strong> I'm trying to get the autocomplete plugin at <a href="http://www.devbridge.com/projects/autocomplete/jquery/#howto" rel="noreferrer">http://www.devbridge.com/projects/autocomplete/jquery/#howto</a> to work.</p>
  
  <p>javascript:</p>
  
  <pre><code> $(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); },
  });
  </code></pre>
  
  <p>ASP:</p>
  
  <pre><code>&lt;% 
  response.ContentType = "application/json"
  response.write("{ query:'Li', suggestions:['Liberia','Libyan Arab Jamahiriya','Liechtenstein','Lithuania'], data:['LR','LY','LI','LT'] }") 
  %&gt;
  </code></pre>
  
  <p>Autocomplete is not working. It works if I use a local lookup array like
      lookup: ['January', 'February', 'March', 'April', 'May']</p>
  
  <p>But there's something wrong with the ajax meaning it doesn't return the list properly.</p>