클래스에 대한 node.js 소개 일종의 간단한 로그인/로그 아웃/userID 시스템을 처리하는 cgi 스크립트를 프로그래밍하는 데 사용하고 있습니다.예기치 않은 토큰 ILLEGAL-response.write() 오류
var response = require('HTTP');
login = inputReader('QUERY_STRING');
if (login === "false" || login === "logout") {
response.writeHead(200, {'Content-Type': 'text/html'});
response.write(
" <!doctype html>
<head>
<title>Session Makes</title>
<meta name='Author' content='Sam Judson'>
<meta name='Contact' content='[email protected]'>
<link rel='stylesheet' href='SessionMaker.css'>
</head>
<body>
<h1>The way is shut.</h1>
<form action='' method='put'>
<input type='text' name='login'>
<input type='submit' name='login' value='Login'>
</form>
</body>
</html> "
);
};
: 나는 클라이언트에 HTML을 손으로하는 response.write()
방법을 사용하려고하는 경우, 내가 인용 부호에 Unexpected Token ILLEGAL
오류가 발생하고있어 나는이하지만 문제가 있어요 어디 내 문자열을 시작하고 오류는 줄 7 시작하는 따옴표로 throw됩니다 가져옵니다. 나는 (대괄호 안의 문자열을 넣는 등) 큰 따옴표, 중첩 따옴표, 따옴표 제거, 따옴표 제거 등을 할 수있는 모든 것에 대해 시도했지만 아무것도 보이지 않습니다. 일하다. 이상한 일은 내가하고 싶은 것과 똑같은 일을하는 웹 사이트에서 여러 가지 예를 보았습니다. 그런 문제는 없습니다.
뭔가를 추가 사용
탈출하여
:
이
오류가 발생합니다. emacs에서 html은 완전히 포함 된 문자열입니다. 그 원인을 몰라. –