Use of meta tags

Discussion in 'Javascript' started by Robert, Oct 3, 2004.

  1. Robert

    Robert Guest

    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, Oct 3, 2004
    #1
    1. Advertising

  2. Robert wrote:

    > 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?


    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
    David Dorward, Oct 3, 2004
    #2
    1. Advertising

  3. On 3 Oct 2004 10:37:24 -0700, Robert <> wrote:

    [snip]

    > 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?


    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.
    Michael Winter, Oct 3, 2004
    #3
  4. Robert

    Lars Eighner Guest

    In our last episode,
    <>, the lovely and
    talented Robert broadcast on comp.lang.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?


    Yes.

    --
    Lars Eighner -finger for geek code- http://www.io.com/~eighner/
    If it wasn't for muscle spasms, I wouldn't get any exercise at all.
    Lars Eighner, Oct 4, 2004
    #4
  5. David Dorward wrote:

    > Robert wrote:
    >> 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.


    *Any* page (better: document) may be used offline, that's why the HTML 4.01
    specification recommends to include that element in any HTML document that
    requires it according to the characters used therein.


    PointedEars
    --
    Old programmers never die, they just disassemble.
    Thomas 'PointedEars' Lahn, Oct 23, 2004
    #5
  6. Thomas 'PointedEars' Lahn wrote:

    Why are you resurrecting three week old threads?

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


    > *Any* page (better: document) may be used offline,


    They may also be transcoded to a different character encoding by a proxy
    server or http user agent - which would make the meta declaration wrong.

    > that's why the HTML
    > 4.01 specification recommends to include that element in any HTML document
    > that requires it according to the characters used therein.


    Where does it recommend this?


    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Oct 24, 2004
    #6
  7. David Dorward wrote:

    > Thomas 'PointedEars' Lahn wrote:
    >
    > Why are you resurrecting three week old threads?


    Why don't you understand that NetNews is not an Internet chat?

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

    >> *Any* page (better: document) may be used offline,

    >
    > They may also be transcoded to a different character encoding by a proxy
    > server or http user agent - which would make the meta declaration wrong.


    That's not the concern of the author of the document but of the person who
    misconfigured the proxy or user agent. The "meta" element should only be
    used as alternative to HTTP headers.

    >> that's why the HTML 4.01 specification recommends to include that element
    >> in any HTML document that requires it according to the characters used
    >> therein.

    >
    > Where does it recommend this?


    <http://www.w3.org/TR/html4/charset.html#h-5.2.2>


    PointedEars
    --
    The television business is a long plastic hallway, where theives and pimps
    run rampant, and good men die like dogs.
    Thomas 'PointedEars' Lahn, Oct 24, 2004
    #7
  8. Robert

    Randy Webb Guest

    David Dorward wrote:

    > Thomas 'PointedEars' Lahn wrote:
    >
    > Why are you resurrecting three week old threads?


    Three things come to mind:

    1) He is too stupid to wipe his ass so he replies to three week old
    threads in the hopes that noone will bother to correct his stupid self.

    2) He lacks the intelligence to answer in a timely manner and keep up
    with the conversation.

    3) Both of the above.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Answer:It destroys the order of the conversation
    Question: Why?
    Answer: Top-Posting.
    Question: Whats the most annoying thing on Usenet?
    Randy Webb, Oct 24, 2004
    #8
  9. Robert

    Jim Ley Guest

    On Sun, 24 Oct 2004 13:28:59 +0200, Thomas 'PointedEars' Lahn
    <> wrote:

    >David Dorward wrote:
    >> They may also be transcoded to a different character encoding by a proxy
    >> server or http user agent - which would make the meta declaration wrong.

    >
    >That's not the concern of the author of the document but of the person who
    >misconfigured the proxy or user agent. The "meta" element should only be
    >used as alternative to HTTP headers.


    It's not a misconfigured proxy, charset transcoding is a legitimate
    job of a proxy. You'll notice user agents like IE also do transcoding
    when you save the files.

    >> Where does it recommend this?

    >
    ><http://www.w3.org/TR/html4/charset.html#h-5.2.2>


    More precisely? It only says CAN in that section that I can see, not
    even a SHOULD, I see no recommendation.

    Jim.
    Jim Ley, Oct 24, 2004
    #9
  10. Jim Ley wrote:

    > [...] Thomas 'PointedEars' Lahn [...] wrote:
    >> David Dorward wrote:
    >>> They may also be transcoded to a different character encoding by a proxy
    >>> server or http user agent - which would make the meta declaration wrong.

    >> That's not the concern of the author of the document but of the person
    >> who misconfigured the proxy or user agent. The "meta" element should
    >> only be used as alternative to HTTP headers.

    >
    > It's not a misconfigured proxy, charset transcoding is a legitimate
    > job of a proxy. You'll notice user agents like IE also do transcoding
    > when you save the files.


    And your point is ...?

    >>> Where does it recommend this?

    >> <http://www.w3.org/TR/html4/charset.html#h-5.2.2>

    >
    > More precisely? It only says CAN in that section that I can see, not
    > even a SHOULD,


    My "should" was not a "SHOULD" in the IETF sense, more in common sense.

    > I see no recommendation.


    The entire HTML 4.01 Specification is a Recommendation and includes:

    | 5.2.2 Specifying the character encoding
    | [...]
    | The HTTP protocol ([RFC2616], section 3.7.1) mentions ISO-8859-1 as a
    | default character encoding when the "charset" parameter is absent from
    | the "Content-Type" header field. In practice, this recommendation has
    | proved useless because some servers don't allow a "charset" parameter
    | to be sent, and others may not be configured to send the parameter.
    | Therefore, user agents must not assume any default value for the
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | "charset" parameter.
    ^^^^^^^^^^^^^^^^^^^^
    |
    | To address server or configuration limitations, HTML documents may include
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | explicit information about the document's character encoding; the META
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | element can be used to provide user agents with this information.
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


    PointedEars
    Thomas 'PointedEars' Lahn, Oct 24, 2004
    #10
  11. Robert

    Jim Ley Guest

    On Sun, 24 Oct 2004 15:00:45 +0200, Thomas 'PointedEars' Lahn
    <> wrote:

    >Jim Ley wrote:
    >
    >> [...] Thomas 'PointedEars' Lahn [...] wrote:
    >>> David Dorward wrote:
    >>>> They may also be transcoded to a different character encoding by a proxy
    >>>> server or http user agent - which would make the meta declaration wrong.
    >>> That's not the concern of the author of the document but of the person
    >>> who misconfigured the proxy or user agent. The "meta" element should
    >>> only be used as alternative to HTTP headers.

    >>
    >> It's not a misconfigured proxy, charset transcoding is a legitimate
    >> job of a proxy. You'll notice user agents like IE also do transcoding
    >> when you save the files.

    >
    >And your point is ...?


    That including of a META charset for html documents is unsafe, as it's
    likely to be incorrect after transcoding (one of the points we've been
    discussing in the thread)

    >> More precisely? It only says CAN in that section that I can see, not
    >> even a SHOULD,

    >
    >My "should" was not a "SHOULD" in the IETF sense, more in common sense.


    So you're now applying your common sense to the specification and
    reporting it as fact, when it doesn't actually say any such thing.

    Jim.
    Jim Ley, Oct 24, 2004
    #11
  12. "Randy Webb" <> wrote in message news:...
    > David Dorward wrote:
    >
    > > Thomas 'PointedEars' Lahn wrote:
    > >
    > > Why are you resurrecting three week old threads?

    >
    > Three things come to mind:
    >
    > 1) He is too stupid to wipe his ass so he replies to three week old
    > threads in the hopes that noone will bother to correct his stupid self.
    >
    > 2) He lacks the intelligence to answer in a timely manner and keep up
    > with the conversation.
    >
    > 3) Both of the above.
    >
    > --
    > Randy
    > comp.lang.javascript FAQ - http://jibbering.com/faq
    > Answer:It destroys the order of the conversation
    > Question: Why?
    > Answer: Top-Posting.
    > Question: Whats the most annoying thing on Usenet?


    You Randy are an Internet asshole. How old are you? Have you any loved ones? Cause
    I can tell you, here, you are loved about as much as a can of droppings from a Dodo bird.

    When you respond on point you do have useful information and I appreciate it.
    But when it comes to public manners you have a lot to learn. You are always looking for a confrontation.

    --
    George Hester
    __________________________________
    George Hester, Oct 24, 2004
    #12
  13. Jim Ley wrote:

    > [...] Thomas 'PointedEars' Lahn [...] wrote:
    >> Jim Ley wrote:
    >>> [...] Thomas 'PointedEars' Lahn [...] wrote:
    >>>> David Dorward wrote:
    >>>>> They may also be transcoded to a different character encoding by a
    >>>>> proxy server or http user agent - which would make the meta
    >>>>> declaration wrong.
    >>>> That's not the concern of the author of the document but of the person
    >>>> who misconfigured the proxy or user agent. The "meta" element should
    >>>> only be used as alternative to HTTP headers.
    >>> It's not a misconfigured proxy, charset transcoding is a legitimate
    >>> job of a proxy. You'll notice user agents like IE also do transcoding
    >>> when you save the files.

    >> And your point is ...?

    >
    > That including of a META charset for html documents is unsafe, as it's
    > likely to be incorrect after transcoding (one of the points we've been
    > discussing in the thread)


    A transcoding proxy or user agent must address issues arising from the
    possibility that the character declaration technique described in the
    Specification is used, and therefore remove or modify the character
    declaration then; if it does not, it is broken.

    >>> More precisely? It only says CAN in that section that I can see, not
    >>> even a SHOULD,

    >> My "should" was not a "SHOULD" in the IETF sense, more in common sense.

    >
    > So you're now applying your common sense to the specification and

    ^^^^^^^^^^^^^^^^^
    > reporting it as fact, when it doesn't actually say any such thing.


    Don't be ridiculous. Again, among other things, the Specification says:

    | Therefore, user agents must not assume any default value for the
    | "charset" parameter.
    |
    | To address server or configuration limitations, HTML documents may include
    | explicit information about the document's character encoding; the META
    | element can be used to provide user agents with this information.  

    Since reasonable authors are eager to provide useful content, they
    would address the problem as recommended instead of ignoring it.


    PointedEars
    --
    if only RAID made a spray for computers...
    Thomas 'PointedEars' Lahn, Oct 24, 2004
    #13
  14. Robert

    Randy Webb Guest

    George Hester wrote:

    <--snip-->

    > You Randy are an Internet asshole.


    Yippeee!!!!!!!!! Let's have a party. I made it to the rank of "Internet
    asshole".

    > How old are you?


    Old enough to know how to quote, snip and use my intelligence.

    > Have you any loved ones?


    Any WHAT? loved ones? Is that some Martian thing? Oh wait, I might have
    some of those in the closet somewhere.


    > Cause I can tell you, here, you are loved about as much
    > as a can of droppings from a Dodo bird.


    And you are mistakingly thinking that your opinion of me means more to
    me than the molecular weight of whale shit on the bottom of the ocean.

    >
    > When you respond on point you do have useful
    > information and I appreciate it.


    And I am glad I could help you, and that you appreciate it.

    > But when it comes to public manners you have a lot to learn.


    I have always said "When I stop learning, its time to die", so I
    actually take that as a compliment and an assurance of a long life.



    > You are always looking for a confrontation.


    ME? A Confrontation? Nah, only when I have a difference of opinion and I
    try to discuss/debate that difference and it turns ugly. I won't back
    down from being ugly, but I dont "look" for it. With people like
    PointedHead, I have enough fun as it is, I don't have to look for more.

    But the sad irony is that he actually has some good ideas sometimes. Its
    when he starts babbling about three week old threads and he attempts to
    change the meaning of words in English (which isn't his native language)
    to fit his arguments that it gets too much to bear.

    Besides, Boston is 1 game up, leading 2-0 as I type this, what do I care?

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Oct 25, 2004
    #14
  15. Thomas 'PointedEars' Lahn wrote:

    > A transcoding proxy or user agent must address issues arising from the
    > possibility that the character declaration technique described in the
    > Specification is used, and therefore remove or modify the character
    > declaration then; if it does not, it is broken.


    My MIME isn't fantastic, so I might be wrong here... but I suspect that
    anything declared as text/something can be treated as text and thus
    transcoded without the user agent needing to know anything about HTML in
    specific.

    > Don't be ridiculous. Again, among other things, the Specification says:
    >
    > | Therefore, user agents must not assume any default value for the
    > | "charset" parameter.


    It wouldn't be assuming anything. The HTTP header trumps <meta> http-equiv
    pseudo whatsits, so it would be following the information given in said
    header.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Oct 26, 2004
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Latter
    Replies:
    4
    Views:
    402
    John Latter
    Sep 7, 2003
  2. A Leon

    use of meta tags.

    A Leon, Apr 10, 2004, in forum: HTML
    Replies:
    17
    Views:
    717
    David Dorward
    Apr 11, 2004
  3. Alan J. Flavell
    Replies:
    0
    Views:
    452
    Alan J. Flavell
    Jul 22, 2003
  4. Donald Firesmith

    html tags within meta tags allowed?

    Donald Firesmith, Jan 5, 2005, in forum: XML
    Replies:
    5
    Views:
    894
    Andy Dingley
    Jan 8, 2005
  5. Goofy
    Replies:
    2
    Views:
    335
    Mark Rae
    Dec 18, 2006
Loading...

Share This Page