我的网站存在问题。我的网站是用Node,Express,MongoDB和Angular创建的。这很好用。现在我想使用一些JavaScript函数,我已经创建了一个外部JavaScript文件。在Chrome中,JavaScript功能运行良好,但是当我尝试使用Mozilla浏览器或移动版Mozilla,Chrome或Safari时,它通常不会加载我的JavaScript文件。有时确实如此。我曾尝试更改我的jade文件中的脚本顺序,也排除了其他一些脚本,但似乎无法弄清问题是什么。这是scripts.js文件不起作用。
这是由Express呈现的我的Jade文件:
html
head
meta(charset="UTF-8")
meta(name="viewport" content="width=device-width, initial-scale=1.0")
<!-- CSS -->
<!-- load bootstrap & font awesome -->
link(rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css")
link(rel="stylesheet" type="text/css" href="/stylesheets/slick.css")
link(rel="stylesheet" type="text/css" href="/stylesheets/slick-theme.css")
link(rel="stylesheet" href="/stylesheets/font-awesome.css")
link(rel="stylesheet" href="/stylesheets/grid.css")
link(rel="stylesheet" href="/stylesheets/styles.css")
link(rel="stylesheet" href="/stylesheets/nav.css")
link(rel="stylesheet" href="/stylesheets/responsive.css")
link(rel="stylesheet" href="/stylesheets/colors.css")
link(rel="stylesheet" href="/stylesheets/slicknav.css")
<!-- JS -->
<!-- load angular, ngRoute, ngAnimate -->
script(type="application/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular.min.js")
script(type="application/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular-route.js")
script(type="application/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular-animate.js")
script(type="application/javascript" src="/javascripts/jquery-3.2.0.min.js")
script(type="application/javascript" src="/javascripts/jquery-ui.min.js")
script(type="application/javascript" src="/javascripts/app.js")
script(type="application/javascript" src="/javascripts/controller.js")
script(type="application/javascript" src="/javascripts/jquery.slicknav.min.js")
script(type="application/javascript" src="/javascripts/slick.js")
script(type="application/javascript" src="/javascripts/scripts.js")
base(href="/")
body(ng-app="loodgietersApp" ng-controller="MainCtrl")
div(id="fb-root")
script.
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
window.___gcfg = {lang: 'nl'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/platform.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
div(class="app-container")
div(ng-include="'partials/includes/nav-bar-desktop.html'")
div(class="slider-image")
div(class="call-us")
span(class="phone-icon fa fa-phone fa-3x")
span(class="phonenumber")
span Bel gratis: 0800 - 2400 000
span(class="available")
span 24/7 bereikbaar
div(class="logo")
a(href="/")
img(src="/images/loodgieters-logo.png" alt="loodgieter-logo")
div(ng-include="'partials/includes/nav-bar-mobile.html'")
div(ng-include="'partials/includes/usps.html'")
div(ng-include="'partials/includes/search-plumber.html'")
div(class="box")
div(class="page-animate page" ng-view)
div(ng-include="'partials/includes/twitter-box.html'")
div(class="container")
div(ng-include="'partials/includes/brands.html'")
div(ng-include="'partials/includes/specialisations.html'")
div(ng-include="'partials/includes/footer.html'")