user1795832
user1795832

Reputation: 2160

Google Apps Script jquery autocomplete not displaying <ul> list when typing in characters

I'm working on a fairly complex form using Google Apps Script HtmlService and jquery. I'm trying to use the autocomplete feature from jquery, and its working somewhat. If I start typing in "ja", then using the down arrow key it will scroll through results. However what it should be doing is displaying them in a list dynamically like it does locally. There is an error in the console, but don't know what to make of it:

Error 4089105213-maestro_htmlapp_bin_maestro_htmlapp.js:55 pl 4089105213-maestro_htmlapp_bin_maestro_htmlapp.js:55

<!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<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="demo">
<div class="ui-widget">
  <label for="tags">Tags: </label>
  <input id="tags" />
</div>
</div><!-- End demo -->

</body>
</html>

Upvotes: 0

Views: 308

Answers (1)

user5339442
user5339442

Reputation: 1

If you load the Jquery resources (Javascript and CSS files) using HTTPS instead of HTTP it works inside google apps scripts.

<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="https://code.jquery.com/jquery-1.8.2.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>

Upvotes: 0

Related Questions