JavaScript

TypeError: $(…).autocomplete is not a function – bootstrap-autocomplete

Share your learning

I encountered this issue, autocomplete is not a function. I had used the bootstrap-autocomplete plugin. 

I had imported the bootstrap autocomplete javascript file to my project. Then what can be the reason for this error “TypeError: $(…).autocomplete is not a function”.

Autocomplete is not a function (Solution)

Here is the solution for this error. I forgot to import the jquery ui library which caused this error and unfortunately I did not find this dependency requirement in the official bootstrap-autocomplete documentation.

The following steps can ensure the solution,

  1. Import the jquery UI library file or use CDN for this.
  2. Import the bootstrap-autocomplete file or use CDN for this.

The order of importing the above files should be the same as given above. Because bootstrap-autocomplete needs the jquery UI as its dependency.

Satpal

Recent Posts

How to Switch PHP Versions in XAMPP Easily: Managing Multiple PHP Versions on Ubuntu

Today we are going to learn about managing multiple PHP versions on ubuntu with xampp.…

1 year ago

How to Use Coding to Improve Your Website’s SEO Ranking?

Let's understand about how to use coding to improve your website's SEO. In today’s computerized…

1 year ago

Most Important Linux Commands for Web Developers

Let's understand the most important linux commands for web developers. Linux, as an open-source and…

1 year ago

Top 75+ Laravel Interview Questions Asked by Top MNCs

Today we are going to discuss top 75+ Laravel interview questions asked by top MNCs.Laravel,…

1 year ago

Mailtrap Integration for Email Testing with Laravel 10

Today we will discuss about the Mailtrap integration with laravel 10 .Sending and receiving emails…

1 year ago

Firebase Cloud Messaging (FCM) with Ionic 6: Push Notifications

Today we are going to integrate FCM (Firebase Cloud Messaging) push notifications with ionic application.Firebase…

1 year ago