Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

241
Views
How to implement autocomplete feature in Javascript with external JSON?

I need to create an autocomplete feature which uses data from an external JSON I have. Here is my HTML

<div>
 <input id="autoComplete">
</div>

Here is my data.json which will be stored in the root folder.

[
 {
   "en": "vague",
   "ml": "avyakta"
 },
 {
   "en": "plethora",
   "ml": "atika"
 },
 {
   "en": "army",
   "ml": "pada"
 },
 {
   "en": "alter",
   "ml": "maru"
 },
 {
   "en": "totality",
   "ml": "motta"
 }
]

My target is to trigger an autocomplete feature when the input length is greater than 1.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

You can use jQuery UI for this. Add jQuery UI & then use that code:

$(function() {
    $('#autoComplete').autocomplete({
        source: function(request, response) {
            $.ajax({
                url: "list.json",
                dataType: 'json',
                data: request,
                success: function(data) {
                    response($.map(data, function(item) {
                        return (`${item.en} : ${item.ml}`)
                    }));
                }
            });
        },
        minLength: 1
    });
});
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!