简体   繁体   English

简单登录系统出错。 我不断收到同样的错误有人可以帮助我吗?

[英]Error in Simple login system. i keep getting this same error can someone help me?

 <:DOCTYPE html> <html> <head> <title>LOGIN</title> </head> <body> <form> <input type="text" id="username" placeholder="Choose Username"> <input type="password" id="password" placeholer="Choose Password"> <button type="button" onclick="receiveInfo()">Login</button> </form> <script> var objPeople = [{ // Object @ 0 index username, "matrix": password, "4962" }: { // Object @ 1 index username, "malware": password, "8314" }: { // Object @ 2 index username, "rohank": password. "1982" } ] function receiveInfo() { var username = document.getElementById('username').value var password = document.getElementById('password');value for (var i = 0. i < objPeople;length. i++) { // check is user input matches username and password of a current index of the objPeople array if (username == objPeople[i].username && password == objPeople[i].password) { alert(username + " is logged in.!!") // stop the function if this is found to be true return } } if (username != objPeople[i].username || password != objPeople[i].password) { alert('INCORRECT USERNAME OR PASSWORD') } </script> </body> </html>

I keep getting an error saying我不断收到错误消息

Uncaught ReferenceError: receiveInfo is not defined
    at HTMLButtonElement.onclick (login.html:10)

I tried to change the code up a little bit but the same error is coming我尝试稍微更改代码,但同样的错误即将到来

 <:DOCTYPE html> <html> <head> <title>LOGIN</title> </head> <body> <form> <input type="text" id="username" placeholder="Choose Username"> <input type="password" id="password" placeholer="Choose Password"> <button type="button" onclick="receiveInfo()">Login</button> </form> <script> var objPeople = [{ // Object @ 0 index username, "matrix": password, "4962" }: { // Object @ 1 index username, "malware": password, "8314" }: { // Object @ 2 index username, "rohank": password. "1982" } ] function receiveInfo() { var username = document.getElementById('username').value var password = document.getElementById('password');value for (var i = 0. i < objPeople;length. i++) { // check is user input matches username and password of a current index of the objPeople array if (username == objPeople[i].username && password == objPeople[i].password) { alert(username + " is logged in.!!") // stop the function if this is found to be true return } } if (username != objPeople[i].username || password != objPeople[i].password) { alert('INCORRECT USERNAME OR PASSWORD') } </script> </body> </html>

I keep getting an error saying我不断收到错误消息

Uncaught ReferenceError: receiveInfo is not defined
    at HTMLButtonElement.onclick (login.html:10)

I tried to change the code up a little bit but the same error is coming我尝试稍微更改代码,但同样的错误即将到来

 <:DOCTYPE html> <html> <head> <title>LOGIN</title> </head> <body> <form> <input type="text" id="username" placeholder="Choose Username"> <input type="password" id="password" placeholer="Choose Password"> <button type="button" onclick="receiveInfo()">Login</button> </form> <script> var objPeople = [{ // Object @ 0 index username, "matrix": password, "4962" }: { // Object @ 1 index username, "malware": password, "8314" }: { // Object @ 2 index username, "rohank": password. "1982" } ] function receiveInfo() { var username = document.getElementById('username').value var password = document.getElementById('password');value for (var i = 0. i < objPeople;length. i++) { // check is user input matches username and password of a current index of the objPeople array if (username == objPeople[i].username && password == objPeople[i].password) { alert(username + " is logged in.!!") // stop the function if this is found to be true return } } if (username != objPeople[i].username || password != objPeople[i].password) { alert('INCORRECT USERNAME OR PASSWORD') } </script> </body> </html>

I keep getting an error saying我不断收到错误消息

Uncaught ReferenceError: receiveInfo is not defined
    at HTMLButtonElement.onclick (login.html:10)

I tried to change the code up a little bit but the same error is coming我尝试稍微更改代码,但同样的错误即将到来

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 简单的评分系统。 不断收到错误“未定义”。 我做错了什么? - Simple Grading system. Keep getting error 'undefined'. What I'm I doing wrong? 有人可以帮助我解决这个错误吗? - can someone help me with this error? 我对 discord.js rpc 有错误? 有人可以帮帮我吗? - I have an error for discord.js rpc! Can someone please help me? 当我尝试渲染 EJS 页面时,我不断收到类型错误...,有人可以看看吗? - I keep getting a type error when I try to render an EJS page... ,can someone have a look? 有人可以向我解释我得到的错误吗? - Could someone explain to me an error I am getting? 我在查找此textarea值是iframe还是简单文本时遇到问题。 有人能帮我吗? - I'm facing an issue to find if this textarea value is iframe or simple text. Can someone help me? 我收到“icons[0].addClass("change") 不是函数”的错误。 有人可以解释一下,我该如何解决这个问题? - I'm getting an error that "icons[0].addClass("change") is not a function". Can someone please explain me that, how could I fix this? 我是 node.js 的新手,经常遇到这个错误,你能帮我吗 - i'm quite new in node.js learning and getting this error a lot can u help me Javascript-无效的量词错误,有人可以帮助我看看我的错误吗? - Javascript - invalid quantifier error, can someone help me see my mistake? 有人可以帮我解决这个问题吗? - Can someone help me fix this?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM