Lov*_*ock 8 html javascript meta utf-8 character-encoding
随机获取此问题出现在我的Firefox的Web控制台(是js选项卡)
它刚刚出现,不能将它与我所做的任何改变联系起来.
完整的错误是:
The page was reloaded, because the character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. The encoding declaration needs to be moved to be within the first 1024 bytes of the file.
Run Code Online (Sandbox Code Playgroud)
或者这一个:
The character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. When viewed in a differently-configured browser, this page will reload automatically. The encoding declaration needs to be moved to be within the first 1024 bytes of the file.
Run Code Online (Sandbox Code Playgroud)
问题指向这一行:
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
Run Code Online (Sandbox Code Playgroud)
对我来说,那个meta标签还可以吗?任何帮助,因为我认为它是冲突的,并导致其他事情的问题.
克雷格
Que*_*tin 12
Charset是内容类型的参数,而不是单独的属性:
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
Run Code Online (Sandbox Code Playgroud)
或者,如果要使用HTML 5样式:
<meta charset="utf-8">
Run Code Online (Sandbox Code Playgroud)
您还应该注意错误消息:
预扫描文件的前1024个字节时找不到
您可能需要将元标记移动到文档中.理想情况下,它应该是内部的第一个标签<head>.