autocomplete is not a function
See original GitHub issueHi, I’m working on a rails application using materializecss gem.
markup:
<div class="row">
<div class="col s12">
<div class="row">
<div class="input-field col s13">
<i class="material-icons prefix">textsms</i>
<input type="text" id="autocomplete" class="autocomplete">
<label for="autocomplete">Autocomplete</label>
</div>
</div>
</div>
</div>
js:
$(document).ready(function(){
$('input.autocomplete').autocomplete({
data: {
"Apple": null,
"Microsoft": null,
"Google": null
}});
});
but got the error: TypeError: $(‘input.autocomplete’).autocomplete is not a function. (In ‘$(‘input.autocomplete’).autocomplete’, ‘$(‘input.autocomplete’).autocomplete’ is undefined)
Then, I tried to execute following snippet in browser console:
$('input.autocomplete').autocomplete({
data: {
"Apple": null,
"Microsoft": null,
"Google": null
}});
Then, the autocomplete works. Could anybody help with this? Thank you very much.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
jquery - .autocomplete is not a function Error - Stack Overflow
When I run the application from visual studio it worked all fine, but when I published the project and tested it , I've...
Read more >TypeError: $(...).autocomplete is not a function in jQuery
To solve the "$(...).autocomplete is not a function" jQuery error, make sure to load the jQuery library before loading the jQuery UI library....
Read more >TypeError autocomplete is not a function | Edureka Community
I am getting the TypeError: $(...).autocomplete is not a function when using the following code inside a Drupal module.
Read more >Uncaught typeerror $(...).autocomplete is not a function jQuery ...
Another case of getting TypeError: $(…).autocomplete is not a function is when you miss the jQuery UI library. Use CDN of Jquery UI...
Read more >How to solve jQuery autocomplete is not a function in ...
Here is my script, I don't know what is the problem but it show JQuery autocomplete is not a function in console.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Happening here also
I wrapped it then under
$(document).ready
as suggested and it works fine.Also happening with plain html , ‘$(document).ready()’ solves the problem