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

  • Home
  • SEARCH
  • 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 802097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:32:49+00:00 2026-05-14T23:32:49+00:00

I am implementing a jquery autocomplete on a search form and am getting the

  • 0

I am implementing a jquery autocomplete on a search form and am getting the suggestions from the Google Search Appliance Autocomple suggestions service which returns a result set in json.

What I am trying to do is go off to the GSA to get suggestions when the user types something in the search box.

The url to get the json suggestions is as follows:

http://gsaurl/suggest?q=<query>&max=10&site=default_site&client=default_frontend&access=p&format=rich

The json which is returned is as follows:

{ "query":"re", "results": [ {"name":"red", "type":"suggest"}, {"name":"read", "type":"suggest"}] }

The jQuery autocomplete code is as follows:

$(#q).autocomplete(searchUrl, {
width: 320,
dataType: 'json',
highlight: false,
scroll: true,
scrollHeight: 300,
parse: function(data) {
 var array = new Array();

 for(var i=0;i<data.results.length;i++)
 {
  array[i] = { data: data.results[i], value: data.results[i].name, result: data.results[i].name };
 }

 return array;
},
formatItem: function(row) { 
 return row.name;
}

});

This works in IE but fails in firefox as the data returned in the parse function is null.
Any ideas why this would be the case?

Workaround

I created an aspx page to call the GSA suggest service and to return the json from the suggest service. Using this page as a proxy and setting it as the url in the jQuery autocomplete worked in both IE and FireFox.

  • 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-14T23:32:50+00:00Added an answer on May 14, 2026 at 11:32 pm

    Workaround

    I created an aspx page to call the GSA suggest service and to return the json from the suggest service. Using this page as a proxy and setting it as the url in the jQuery autocomplete worked in both IE and FireFox.

    Proxy code

    string responseText;
    
                try
                {
                    Uri gsaUrl = new Uri(GetSuggestUrl());
    
                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(gsaUrl);
                    request.ContentType = "application/x-www-form-urlencoded";
                    request.Method = WebRequestMethods.Http.Get;                
    
                    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                    Stream responseStream = response.GetResponseStream();
                    StreamReader streamReader = new StreamReader(responseStream);
    
                    responseText = streamReader.ReadToEnd();
    
                }
                catch(Exception e)
                {
                    throw new Exception(e.Message, e.InnerException);
                }           
    
                string json = responseText;
                Response.Clear();
                //Response.ContentType = "application/json; charset=utf-8";
                Response.Write(json);
    
            }
    
            private string GetSuggestUrl()
            {
                string url = "http://<GSA>/suggest";
                string query = HttpContext.Current.Request.QueryString["q"];
                int max = 10;
                string site = "site";
                string client = "client";
                string access = "p";
                string format = "rich";
    
                return string.Format("{0}?q={1}&max={2}&site={3}&client={4}&access={5}&format={6}", url, query, max, site, client, access, format); 
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.