我正在使用 Python Flask 開發一個 Web 應用程序。我需要一個 jQuery 腳本來創建自動完成搜索字段。我找到了這個:https://github.com/LukasSliacky/Flask-Autocomplete它工作得很好。當我嘗試將此功能集成到包含許多其他 CSS 和 JS 腳本的現有模板中時,問題就來了。這是我的文件:<!DOCTYPE html><html><head> <meta charset="utf-8"> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="{{ url_for('static', filename='css/materialdesignicons.min.css')}}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/vendor.bundle.base.css')}}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/dataTables.bootstrap4.css')}}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css')}}"> <link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.ico') }}"></head><body><div class="container-scroller"> {{ form.autocomp.label }}: {{ form.autocomp }}</div> <script src="{{ url_for('static', filename='js/vendor.bundle.base.js')}}"></script> <script src="{{ url_for('static', filename='chart.js/Chart.min.js')}}"></script> <script src="{{ url_for('static', filename='js/jquery.dataTables.js')}}"></script> <script src="{{ url_for('static', filename='js/dataTables.bootstrap4.js')}}"></script> <script src="{{ url_for('static', filename='js/off-canvas.js')}}"></script> <script src="{{ url_for('static', filename='js/hoverable-collapse.js')}}"></script> <script src="{{ url_for('static', filename='js/template.js')}}"></script>
未捕獲的類型錯誤:如何修復 jQuery 沖突?
胡子哥哥
2023-08-05 11:03:29