1
Beagleboard에서 웹 서버로 작업하고 있습니다. 서버가 cherrypy로 만들어졌고 다른 웹 페이지를 인증하기위한 로그인 페이지를 만들고 싶습니다.JavaScript를 사용하여 웹 브라우저에서 다른 창을 여는 방법은 무엇입니까?
나는 인터넷에서 볼 수있는 다음과 같은 HTML/자바 스크립트에 코드를 사용하고 있습니다 :
<html>
<head>
<title>
Login page
</title>
</head>
<body>
<h1 style="font-family:Comic Sans Ms;text-align="center";font-size:20pt;
color:#00FF00;>
Simple Login Page
</h1>
<form name="login">
Username<input type="text" name="userid"/>
Password<input type="password" name="pswrd"/>
<input type="button" onclick="check(this.form)" value="Login"/>
<input type="reset" value="Cancel"/>
</form>
<script language="javascript">
function check(form)/*function to check userid & password*/
{
/*the following code checkes whether the entered userid and password are matching*/
if(form.userid.value == "myuserid" && form.pswrd.value == "mypswrd")
{
window.open('pag.html')/*opens the target page while Id & password matches*/
}
else
{
alert("Error Password or Username")/*displays error message*/
}
}
</script>
</body>
</html>
을하지만 다음과 같은 오류가 나타납니다 NotFound: (404, "The path '/home/root/webserver/pag.html' was not found.")
아마도 page.html이나 뭐니? – doppelgreener
'/ home/root/webserver/pag.html' 파일이 존재합니까? – Isaac