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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:23:51+00:00 2026-06-06T17:23:51+00:00

I’m trying to use the Jquery UI Autocomplete to retrieve synonyms for any word

  • 0

I’m trying to use the Jquery UI Autocomplete to retrieve synonyms for any word using a Thesaurus API.

I need to make a following json GET request to access the API

http://words.bighugelabs.com/api/{version}/{api key}/{word}/{format}

Jquery however generates the following which returns a 404 Not Found

http://words.bighugelabs.com/api/?v=2&key=mykey&word=some-word&format=json

Is it possible to easily remove the separators?

Script

$(function() {
        function log( message ) {
            $( "<div/>" ).text( message ).prependTo( "#log" );
            $( "#log" ).scrollTop( 0 );
        }

        $( "#thesaurus" ).autocomplete({
            source: function( request, response ) {
                $.ajax({
                    url: "http://words.bighugelabs.com/api/",
                    dataType: "json",
                    data: {
                        v: "2",
                        key: "mykey", //actually numbers
                        word: request.term,
                        format: "json"
                        //maxRows: 12,
                        //name_startsWith: request.term
                    },
                    success: function( data ) {
                        response( $.map( data.geonames, function( item ) {
                            return {
                                label: item.name + (item.noun ? ", " + item.noun : "") + ", " + item.syn,
                                value: item.name
                            }
                        }));
                    }
                });
            },
            minLength: 2,
            select: function( event, ui ) {
                log( ui.item ?
                    "Selected: " + ui.item.label :
                    "Nothing selected, input was " + this.value);
            },
            open: function() {
                $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
            },
            close: function() {
                $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
            }
        });
    });

HTML

    <input id="thesaurus" />

</div>

<div class="ui-widget" style="margin-top:2em; font-family:Arial">
    Result:
    <div id="log" style="height: 200px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
</div>
  • 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-06-06T17:23:54+00:00Added an answer on June 6, 2026 at 5:23 pm

    The whole point of the data parameter to the $.ajax() function is to create a query string (both POST and GET use query strings, they are just sent as different parts of the request payload). You just want to use simple string concatenation to build your URL.

    $.ajax({
        url: "http://words.bighugelabs.com/api/2/mykey/" + request.term + "/json",
        dataType: "json",
        success: function( data ) {
            response( $.map( data.geonames, function( item ) {
                return {
                    label: item.name + (item.noun ? ", " + item.noun : "") + ", " + item.syn,
                    value: item.name
                }
            }));
        }
    });
    

    You had static version, api key and format parameters but if they were dynamic, the url would look like:

    "http://words.bighugelabs.com/api/" + version + "/" + api_key + "/" + request.term + "/" + format
    

    To make your code a little cleaner you could even go as far as:

    "http://words.bighugelabs.com/api/" + [version,api_key,request.term,format].join("/")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.