语法错误:DOCTYPE标记中的无效字符“ \u0008”消息 [英] SyntaxError: Invalid character '\u0008' message from the DOCTYPE tag
问题描述
我正在设置服务器,并且遇到了一个我从未见过的奇怪错误:
I am setting up a server and am getting a strange error I have never seen before:
它在源代码中抱怨第1行,但这只是 DOCTYPE
标签!
It is complaining about line 1 in the source, but that is just the DOCTYPE
tag!
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -->
...
您可以看到我已经尝试设置 Content-Type
是 utf-8
以外的其他内容。
As you can see I already tried setting the Content-Type
to be something other than utf-8
. What is happening here?
推荐答案
错误的实际原因不在第1行。例如,使用 eval
还会导致在第1行报告错误。
The actual cause of the error is not located at line 1. For example, using eval
also causes errors to be reported at line 1.
在源代码中查找 BACKSPACE U + 0008 字符。 在此。
Look in your source code for the BACKSPACE U+0008 character. A method to spot this invisible character is described here.
这篇关于语法错误:DOCTYPE标记中的无效字符“ \u0008”消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!