【发布时间】:2019-07-26 01:50:45
【问题描述】:
我的静态文件夹中有一个文本文件,其中包含我想在我的 html 页面中用于自动完成搜索的特定大学列表。
这是文本文件(college_list.txt)的格式:
["college1", "college2", ... "final college"]
这是我的布局模板中的自动完成功能:
<!-- Autocomplete JS -->
<link href = "https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel = "stylesheet">
<script src = "https://code.jquery.com/jquery-1.10.2.js"></script>
<script src = "https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script>
$(function() {
var collegeList = [
UPLOADED LIST HERE!!!!
];
$( "#college_search" ).autocomplete({
source: collegeList
});
});
</script>
- routes.py
- models.py
- forms.py
- static
- college_list.txt
-templates
- layout.html (where I want to upload the college_list into autocomplete function)
【问题讨论】:
标签: javascript python arrays flask