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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:25:52+00:00 2026-06-06T05:25:52+00:00

Im trying to get some auto complete to work. I have this URL i

  • 0

Im trying to get some auto complete to work. I have this URL i shoud read my JSON From:

http://openscan.addi.dk/2.0/?action=openScan&field=phrase.title&lower=hest&limit=10&outputType=json

When i receive the result i try to map it into my jquery autocomplete, i use the following jquery:

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

            $("#search").autocomplete({
                source: function (request, response) {
                    $.ajax({
                        url: "http://openscan.addi.dk/2.0/?action=openScan&field=phrase.title&lower=hest&limit=10&outputType=json",
                        dataType: "jsonp",

                        success: function (data) {
                            response($.map(data.scanResponse.term, function (item) {
                                return {
                                    label: item.name+' ( '+item.hitCount+')',
                                    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");
                }
            });
        });
    </script>
    <h2>
        Demo of autocomplete using OpenScan
    </h2>
    Start typing below.<br />
    <input id="search" />

My problem is the result its not like the limited amount of JSON i have seen before, it contains $ and @ for properties, how do I index them?

Edit
Changed data.scanResponse to data.scanResponse.term

  • 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-06T05:25:54+00:00Added an answer on June 6, 2026 at 5:25 am

    Not sure what are exact values you want to display, but you could access properties using array syntax, like this:

    label: item.name["@"]+' ( '+item.hitCount["$"]+')'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay I have been trying to get this to work for some time now.
I'm trying to get some data from a certain web-based api using the libcurl
I'm trying to get element by name, and I have a problem This is
I have some rough code for my project, and I am trying to get
Im trying to get some checkbox with a specific name document.getElementsByName(test); Unfortunatley i cant
Just trying to get some rows out of a database and loop through but
Im trying to get some system information using WMI but the problem is when
I am trying to get some jQuery to disable the confirm button on my
I am trying to get some comments off the car blog, Jalopnik . It
I'm trying to get some data out my templates to, let's say, add an

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.