使用元标记 [英] Use of meta tags

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

问题描述

我对这些元标记有一些疑问:


< meta http-equiv =" Content-Type" content =" text / html;

charset = iso-8859-1">


我应该使用什么字符集?这是拉丁语吗?我有MacOS 10.2.6。

我应该在哪里查找这些信息。


< meta http-equiv =" Content-Script-Type" ; content =" text / javascript">


如果我包含此元标记,是否需要在

脚本标记上指定内容类型?


Robert

I have some questions about these meta tags:

<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

What charset should I use? Is this latin-1? I have MacOS 10.2.6.
Where should I have looked for this information.

<meta http-equiv="Content-Script-Type" content="text/javascript">

If I include this meta tag, do I need to specify content type on the
script tag?

Robert

推荐答案

Robert写道:
Robert wrote:
我有关于这些元标记的一些问题:
< meta http-equiv =" Content-Type" content =" text / html;
charset = iso-8859-1">


这对于设计为离线使用的页面非常有用。真正的HTTP标题

适用于为WWW设计的页面。

我应该使用什么字符集?


这取决于您使用的字符。 UTF-8适用于大多数用途

这些天。当然你需要确保文件真的用

格式编码。声称文件是以其他格式编码的,而实际上这可能会导致更多问题,而不是指定任何



这是latin-1吗?


我相信iso-8859-1是拉丁文1.

我有MacOS 10.2.6。
我应该在哪里查找这些信息。


除了comp.lang.javascript之外的某个地方。你没有提出任何事情

触及关于主题。

< meta http-equiv =" Content-Script-Type"含量="文本/ JavaScript的">
如果我包含这个元标记,我是否需要在
脚本标记上指定内容类型?
I have some questions about these meta tags: <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
This may be useful for pages designed to be used offline. Real HTTP headers
are preferable for pages designed for the WWW.
What charset should I use?
That depends on which characters you use. UTF-8 is good for most purposes
these days. Of course you need to make sure the file really is encoded in
that format. Claiming that a file is encoded in a format other then that
which is really is is likely to cause more problems then not specifying any
at all.
Is this latin-1?
I believe iso-8859-1 is Latin 1.
I have MacOS 10.2.6.
Where should I have looked for this information.
Somewhere other then comp.lang.javascript. Nothing you have raised so
touches upon being on-topic.
<meta http-equiv="Content-Script-Type" content="text/javascript"> If I include this meta tag, do I need to specify content type on the
script tag?




是的,你只做以上适用于放置在内部事件中的脚本

属性(例如onload和onclick)。


-

David Dorward< http ://blog.dorward.me.uk/> < http://dorward.me.uk/>

Home是〜/ .bashrc的地方



Yes you do, the above only applies to script placed inside intrinsic event
attributes (e.g. onload and onclick).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


2004年10月3日10:37:24 -0700,Robert< rc ******* @ my-deja.com>写道:


[snip]
On 3 Oct 2004 10:37:24 -0700, Robert <rc*******@my-deja.com> wrote:

[snip]
我应该使用什么字符集?


这取决于你的内容。如果你用英文写作,ISO-8859-1将会很好。你总是可以用字符

实体指定字符外的字符。

这是[ISO-8859-1] latin-1吗?


是的。

我有MacOS 10.2.6。


这没关系。

我应该在哪里查找这些信息。


我不知道任何具体的参考。谷歌搜索iso-8859产生了很多结果。这将是一个很好的起点。

< meta http-equiv =" Content-Script-Type" content =" text / javascript">

如果我包含此元标记,是否需要在
脚本标记上指定内容类型?
What charset should I use?
It depends on your content. If you''re writing in English, ISO-8859-1 will
be fine. You can always specify characters outside that set with character
entities.
Is this [ISO-8859-1] latin-1?
Yes.
I have MacOS 10.2.6.
That doesn''t matter.
Where should I have looked for this information.
I don''t know of any specific reference. Googling for iso-8859 produces a
lot of results. It would be a good place to start.
<meta http-equiv="Content-Script-Type" content="text/javascript">

If I include this meta tag, do I need to specify content type on the
script tag?




是的,原因有两个:


1)默认的脚本类型,由该META元素指定,适用于

intrinsic事件。

2)需要SCRIPT元素的type属性。


顺便说一下,最好在服务器响应中提供这些信息

标题。您的服务器可能已经传输了字符编码。将这个发送到alt.html或

comp.infosystems也会更好。 www.authoring.html 它的主题是什么。


Mike


-

Michael Winter

替换.invalid与.uk通过电子邮件回复。



Yes, for two reasons:

1) The default script type, as specified by that META element, applies to
intrinsic events.
2) The type attribute for SCRIPT elements is required.

By the way, it''s best to provide this information in the server response
headers. Your server may already transmit the character encoding. It would
also be better to have sent this to alt.html or
comp.infosystems.www.authoring.html where it''s on-topic.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


在我们的最后一集中,

< c6 ************ **************@posting.google.com>,可爱的

才华横溢的罗伯特在comp.lang.javascript播出
In our last episode,
<c6**************************@posting.google.com >, the lovely and
talented Robert broadcast on comp.lang.javascript:
我对这些元标记有一些疑问:
< meta http-equiv =" Content-Type" content =" text / html;
charset = iso-8859-1">
我应该使用什么字符集?这是拉丁语吗?我有MacOS 10.2.6。
我应该在哪里查找这些信息。


首先,http-equiv用于提供服务器通常在http

标头中提供的信息。除非你知道你的服务器是wakko,否则你知道你正在做一些非常不寻常的事情,或者你正在迎合一个非常破碎或可能有一些特殊浏览器的特殊浏览器

不合理或不寻常的默认值,你可能应该单独留下

http-equiv。不要包含这样的元素元素,除非你知道需要它们并且你知道你想要用什么来实现它们。

它们。


这个特别的一个是无用的。它说文件是

html。但是如果浏览器还没有知道(或假设)这个

,它就不知道meta元素是什么。它声明

iso-8859-1作为字符集,这是英语国家和欧洲大部分地区的大多数浏览器会假设它们是

什么也没说。


是的,或多或少是所谓的拉丁1。在某些系统中。

如果您使用字符实体(例如& eacute;)作为重音

字符,并使用引号的q元素,您可能会赢得'' t

即使您实际上没有使用iso-8859-1也会发现任何问题。

< meta http-equiv =" Content-Script-Type"含量="文本/ JavaScript的">
如果我包含此元标记,是否需要在
脚本标记上指定内容类型?
I have some questions about these meta tags: <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"> What charset should I use? Is this latin-1? I have MacOS 10.2.6.
Where should I have looked for this information.
First http-equiv is to supply information usually supplied in http
headers by the server. Unless you know your server is wakko, you
know you are doing something very unusual, or you are catering to a
particular browser that is very broken or likely to have some
unreasonable or unusual defaults, you probably should leave
http-equiv alone. Don''t include such meta elements unless you know
they are needed and you know what you are trying to accomplish with
them.

This particular one is next to useless. It says the document is
html. But if the browser doesn''t already know (or assume) this
already, it won''t know what a meta element is. It declares
iso-8859-1 as the character set, which is what most browsers in
English-speaking countries and much of Europe will assume if they are
told nothing.

Yes, it is more or less what is known as "latin 1" in some systems.
If you are using character entities (such as &eacute;) for accented
characters, and the q element for quotations, you probably won''t
notice any problems even if you are not actually using iso-8859-1.
<meta http-equiv="Content-Script-Type" content="text/javascript"> If I include this meta tag, do I need to specify content type on the
script tag?




是。


-

Lars Eighner - 极客代码的手指 - ei ***** @ io.com http://www.io.com/~eighner /

如果不是因为肌肉痉挛,我根本不会做任何运动。



Yes.

--
Lars Eighner -finger for geek code- ei*****@io.com http://www.io.com/~eighner/
If it wasn''t for muscle spasms, I wouldn''t get any exercise at all.


这篇关于使用元标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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