元标记不在前 1024 个字节中 [英] Meta tag not in first 1024 bytes

查看:40
本文介绍了元标记不在前 1024 个字节中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

警告:在有人将其标记为,请理解并非如此.接受的答案正是我正在做的,但我面临以下问题.

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 文件如下所示:

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?

推荐答案

我所做的是编辑 /usr/lib/meteor/app/lib/app.html.in,并添加元数据字符集行,使文件现在看起来像这样:

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}}
...

当然,我从我的 html 文件中删除了元字符集行.

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.

这篇关于元标记不在前 1024 个字节中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆