Answer the question
In order to leave comments, you need to log in
Why Js script is not connected?
Good afternoon. The js script does not connect to the site, it gives an error net::ERR_ABORTED 404 (Not Found). Tried making the folder static with
app.use(express.static(path.join(__dirname, 'public')))
{{> head}}
<body>
<header>
{{> navbar}}
</header>
{{{ body }}}
</body>
<div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<script src="public/reglog.js"></script>
</div>
</html>
Answer the question
In order to leave comments, you need to log in
Have you tried going through your line step by step?
app.use( // 5
express.static( // 4
path.join( // 3
__dirname, // 1
'public' // 2
)))
<script src="/reglog.js"></script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question