Meta tag not in first 1024 bytes

不羁的心 提交于 2019-12-19 17:42:27

问题


Caveat: Before someone goes and marks this as duplicate of this, please understand that it is not. The accepted answer is exactly what I am doing, yet I am facing the following issue.

HTML file in client folder looks like this:

<head>
    <meta charset="utf-8"/>
    <title>blah-blah</title>
    ---

The message I am getting in the firebug console is:

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.

When I do a view source, between the head and the meta charset element, I see a whole bunch of link stylesheet and script tags.

If I remove the meta charset, I get this in the firebug console:

The character encoding of the HTML document was not 
declared. The document will render with garbled text 
in some browser configurations if the document 
contains characters from outside the US-ASCII range. 
The character encoding of the page must to be declared 
in the document or in the transfer protocol.

How do I get the meta charset tag to appear right after the head?


回答1:


What I did was edit /usr/lib/meteor/app/lib/app.html.in, and add the meta charset line so that the file now looks like this:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>    //**Added this line**
{{#each stylesheets}}  <link rel="stylesheet" href="{{this}}">
{{/each}}
...

And of course I removed the meta charset line from my html files.

I think right now, this would be the way to go and this will be resolved in future revisions.




回答2:


I had the problem in IE to force to use the latest version. I had to add

<meta http-equiv="x-ua-compatible" content="IE=edge">

Directly behind the tag. And app.html.in seems not to be used anymore.

So I did this on tools/latest/tools/bundler.js

Line 783

'<head><meta http-equiv="x-ua-compatible" content="IE=edge">\n');

That forced it to add it in the html boilerplate.



来源:https://stackoverflow.com/questions/12244233/meta-tag-not-in-first-1024-bytes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!