Can't get the inline form to autocomplete


#1

https://www.codecademy.com/courses/jquery-ext/projects/jquery-prj_move?user_id=563bb98595e378c69c000049

I'm not getting any error message but this code doesn't work when I run it, I don't get any autocomplete pop-downs.

var main = function() {
$(function(){
  var cities = [
  			"London",
    		"Tokyo",
    		"Phuket",
    		"Beijing",
    		"Moscow",
    		"Paris",
    		"Barcelona",
    		"Venice",		
    
  ];
 
 $('.form-inline').autocomplete({source: cities});   
});
};
 
$(document).ready(main);

#2

I know hardly a thing about JQuery, but I will try it anyway.

There's probably a comma too much in your cities list, after Venice.


#3

Taking out that comma didn't work :/...


#4

And what about the last };, shouldn't that be });?


#5

you must place these links in the head
<script src="https://s3.amazonaws.com/codecademy-content/projects/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="app.js"></script>

this should work


#6

Thank you that solved it! are those jquery libraries?


#7

Yes , in this project they did not put the link of jquery libraries


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.