gpt4 book ai didi

javascript - 尝试多次加载 Angular + 在此页面上多次包含 Google map API

转载 作者:行者123 更新时间:2023-12-03 03:32:40 25 4
gpt4 key购买 nike

每当我按下 website 上的“开始”按钮时,屏幕变黑,我在控制台日志中收到以下错误。在运行 grunt build 并将其部署到 Heroku 之前,我在本地没有看到此问题:

WARNING: Tried to load angular more than once.

You have included the Google Maps API multiple times on this page. This may cause unexpected errors.

我的index.html的代码如下,完整代码here :

  <script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=AIzaSyBHuxIv-E8l4YRp_vWjW7X22gRNwI1xN30"></script>
<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-touch/angular-touch.js"></script>
<script src="bower_components/ngstorage/ngStorage.js"></script>
<script src="bower_components/moment/moment.js"></script>
<script src="bower_components/angular-moment/angular-moment.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.tpl.js"></script>
<script src="bower_components/angular-modal-service/dst/angular-modal-service.js"></script>
<script src="bower_components/vsGoogleAutocomplete/dist/vs-google-autocomplete.js"></script>
<script src="bower_components/vsGoogleAutocomplete/dist/vs-autocomplete-validator.js"></script>
<!-- endbower -->
<!-- endbuild -->

还有什么可能导致该问题?

更新

我也包含了我的 Grunt 任务:https://pastebin.com/3JiaQwXU .

最佳答案

在开发控制台中分析您的页面后,您似乎确实加载了脚本两次。我会解释一下。

按照下图enter image description here

单击“开始”后,您基本上会再次加载整个页面。检查 getstarted.html 的 html。如果您打算使用模板,那么模板应该只有 View 的一部分,而不是从顶部开始的整个网站。

关于javascript - 尝试多次加载 Angular + 在此页面上多次包含 Google map API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46016186/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com