Code isn't working, problems with autocomplete


#1

Hi,

I'm having problems with the autocomplete widget on the MOVE project - I can't find any errors in the code and have tried copying it from the source code the instructions point you to but it's still not working. Anyone have any ideas? Help would be greatly appreciated as this is driving me nuts!

Here's a link to the project: https://www.codecademy.com/courses/jquery-ext/projects/jquery-prj_move?user_id=575addac6c20fe1a9100019b

And here's the code from the HTML and app.js

HTML CODE:
<html>
  <head>
    <link href='https://fonts.googleapis.com/css?family=Oswald:400,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="style.css">
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
    <scrip type="text/javascript" src="app.js"></scrip>
    <script src="https://s3.amazonaws.com/codecademy-content/projects/jquery.min.js"></script>
  </head>
  <body>
    <div class="main">
      <div class="container">
        <h1>Move</h1>
        <p>Form healthy habits to take your fitness to the next level.</p>
        <div class="ui-widget">
          <input type="text" class="form-control" id="townName" placeholder="FIND YOUR CITY">
        </div>
      </div>
    </div>

JQUERY CODE:

var main = function() {
    var cities = [
      "London",
      "Manchester",
      "Edinburgh",
      "Newcastle",
      "Liverpool",
      "Aberdeen",
      "Essex",
      "Glasgow",
      "Dundee",
      "Carlisle",
      "Birmingham",
      "Cornwall",
      "Swansea",
      "York"
    ];
    $( "#townName" ).autocomplete({
      source: cities
    });

};
  
$(document).ready(main);


#2

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