无法将我的 js 文件链接到我的哈巴狗浏览器控制台显示
\n\nThe script from \xe2\x80\x9chttp://localhost:3000/script.js\xe2\x80\x9d was loaded even though its MIME type (\xe2\x80\x9ctext/html\xe2\x80\x9d) is not a valid JavaScript MIME type.\n2 signin\nLoading failed for the <script> with source \xe2\x80\x9chttp://localhost:3000/script.js\xe2\x80\x9d. signin:1:1\nRun Code Online (Sandbox Code Playgroud)\n\n我已经尝试使用脚本标签执行此操作,但我猜我的 js 代码有一些错误,除非代码位于不同的文件中,否则我看不到这些错误。
\n\n这是我的哈巴狗文件
\n\nscript(type=\'text/javascript\' src="http://code.jquery.com/jquery-latest.js")\nscript( type= \'text/javascript\',src="./script.js")\n\n\nform( id=\'formSignIn\')\n div.form-group\n label(for=\'name\') Id:\n input#name.form-control(type=\'text\', placeholder=\'id\' name=\'name\')\n div.form-group\n label(for=\'pw\') Password:\n input#password.form-control(type=\'password\', name=\'password\')\n button.btn.btn-primary(type=\'submit\', id=\'submit\') Sign In\nRun Code Online (Sandbox Code Playgroud)\n\n这是我的js文件
\n\n$(document).ready(function(){\n console.log("hi");\n\n var name,password;\n // $("#submit").click(function(){\n name= $("#name").val();\n password=$("#password").val();\n console.log("$$$$$$$$$$$$$", name, password)\n $.post("/login", {name: name, password: password} ,function(data){\n …Run Code Online (Sandbox Code Playgroud)