Javascript 得到http://localhost:3000/public/js/test.js net::ERR_中止404(未找到)
我尝试将sign_up.liquid与test.js连接起来。但我有错误404 我认为我连接这两个文件的路径是正确的:Javascript 得到http://localhost:3000/public/js/test.js net::ERR_中止404(未找到),javascript,node.js,liquid,Javascript,Node.js,Liquid,我尝试将sign_up.liquid与test.js连接起来。但我有错误404 我认为我连接这两个文件的路径是正确的: <script src="../../public/js/test.js"> </script> <form id="formSignUp" method="POST" onsubmit="return main()"> <h1>Inscription</h1> <input type="
<script src="../../public/js/test.js"> </script>
<form id="formSignUp" method="POST" onsubmit="return main()">
<h1>Inscription</h1>
<input type="text" id="form_input_name" name="name" placeholder="Prénom" size= "30">
<input type="text" id="form_input_surname" name="surname" placeholder="Nom" size= "30">
<input type="text" id="form_input_mail" name="mail" placeholder="E-mail" size= "30">
<input type="password" id="form_input_password" name="password" placeholder="Mot de passe" size= "30">
<input type="password" id="form_input_conf_password" name="conf_password" placeholder="Confirmation de mot de passe" size= "30">
<div id="div_checkNewsletter">
<input type="hidden" name="newsletter" value="0">
<input type="checkbox" id="box_newsletter" name="newsletter" value="1">
<label for="newsletter">En cochant cette case, j’accepte de recevoir <br>les actualités d’Otablo.</label>
</div>
<button type="submit" id="button_orange_center"> Suivant</button>
</form>
我不明白为什么注册。liquid
和test.js
没有链接
我认为我连接这两个文件的路径是正确的
事实并非如此
路径是您在server.js文件中指定的路径,而不是在计算机文件系统中指定的路径
你说:
…因此/public/
中的所有内容都映射到/
下的URL
这意味着路径是:
src="/js/test.js"
我认为我连接这两个文件的路径是正确的
事实并非如此
路径是您在server.js文件中指定的路径,而不是在计算机文件系统中指定的路径
你说:
…因此/public/
中的所有内容都映射到/
下的URL
这意味着路径是:
src="/js/test.js"
src="/js/test.js"