Javascript 找不到HTML文档的字符编码声明

Javascript 找不到HTML文档的字符编码声明,javascript,html,utf-8,character-encoding,meta,Javascript,Html,Utf 8,Character Encoding,Meta,在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

在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.
或者这个:

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.
问题指向这一行:

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />

对我来说,那个元标签没问题吧?任何帮助,因为我认为它是冲突的,并导致与其他事情的问题


Craig

字符集是内容类型的参数,而不是单独的属性:

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />

或者,如果要使用HTML 5样式:

<meta charset="utf-8">

您还应注意错误消息:

预扫描文件的前1024个字节时未找到


您可能需要在文档中移动元标记。理想情况下,它应该是

中的第一个标记。我在Firefox中收到这个错误消息。当我在我的nginx设置中“pagespeed DisableFilters add_head;”时,它消失了。

我将我的init文件(包含要包含在每个页面中的内容)移到meta上方,这一即时消息猜测将头部的meta推到了范围之外。但现在已排序,谢谢:)