user379888
user379888

Reputation:

Autocomplete working in online example but not on Fiddle

Autocomplete is working in the example here but not in my try. What am I missing?

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Autocomplete - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];
    $( "#tags" ).autocomplete({
      source: availableTags
    });
  });
  </script>
</head>
<body>

<div class="ui-widget">
  <label for="tags">Tags: </label>
  <input id="tags">
</div>


</body>
</html>

Upvotes: 2

Views: 359

Answers (2)

Houmam
Houmam

Reputation: 587

You just need to add jQuery and jQuery UI to your jsfiddle (from the jsfiddle sidebar under Frameworks & Extensions).

EDIT:

Your code in (inspuratesystems.com/tuitionteacher) does not work because the jQuery library is not loaded. See the console in inspect element (Ctrl+Shift+I).

enter image description here

Upvotes: 2

Pedro Rog&#233;rio
Pedro Rog&#233;rio

Reputation: 176

The problem was the call of external files (jQuery and jQuery UI). Try this now

<div class="ui-widget">
  <label for="tags">Tags: </label>
  <input id="tags">
</div>

Upvotes: 1

Related Questions