Help? Spec Character Problems w/JAVASCRIPT TOOLTIP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Curious Angel

    Help? Spec Character Problems w/JAVASCRIPT TOOLTIP

    Help? Spec Character Problems w/JAVASCRIPT TOOLTIP

    Hi, I'm experiencing bizarre problems with quote marks that previously displayed
    properly in a Javascript TOOLTIP I wrote a year ago . . . and now, inexplicably,
    won't translate (?). The COPYRIGHT text was originally written using Typographers
    Quotes (in the ALT-0145, ALT-0146, ALT-0147, and ALT-0148 family). For those who
    don't know what I'm talking about, these are the more stylized "curling" quotes.
    When I resurrected this script just this morning, the following happened:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    <script language="JavaS cript"> <!--
    var yumyum="COPYRIG HT © 2004 yada yada.\nThe yada yada’s yada, “YADA YADA,” is yada
    yada yada.";

    BECAME

    <script language="JavaS cript"> <!--
    var yumyum="COPYRIG HT © 2004 yada yada.\nThe yada yada’s yada, “YADA
    YADA,” is yada yada yada.";
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -

    I've noodled around with a few ways of trying to fix this — including (sigh) using
    just plain average quote marks — and _always_ I get these 82~~ codes showing up.
    Even stranger, this never used to happen. The © symbol shows up fine btw, as does
    everything else. Anyone want to attempt helping me with this? Thanks!

    Angel
  • Curious Angel

    #2
    Re: Help? Spec Character Problems w/JAVASCRIPT TOOLTIP

    In article <MPG.1a57830569 1b21819896a8@ne ws.intergate.co m>, byte.this@usa.n et says...[color=blue]
    > Help? Spec Character Problems w/JAVASCRIPT TOOLTIP[/color]

    Never mind . . . I located one of my older demo HTML files and scrutinized the
    differences between them. I had a
    <title>yak yak yak yak yak</title>
    line between the <head> </head> tags in this latest version.

    I dropped the <title> line to just BELOW the </head> line and all my lovely
    typographers quotes are back in business ha ha.

    Go figure. ;)

    Angel

    Comment

    • McKirahan

      #3
      Re: Help? Spec Character Problems w/JAVASCRIPT TOOLTIP

      "Curious Angel" <byte.this@usa. net> wrote in message
      news:MPG.1a578c 932333354f9896a 9@news.intergat e.com...[color=blue]
      > In article <MPG.1a57830569 1b21819896a8@ne ws.intergate.co m>,[/color]
      byte.this@usa.n et says...[color=blue][color=green]
      > > Help? Spec Character Problems w/JAVASCRIPT TOOLTIP[/color]
      >
      > Never mind . . . I located one of my older demo HTML files and scrutinized[/color]
      the[color=blue]
      > differences between them. I had a
      > <title>yak yak yak yak yak</title>
      > line between the <head> </head> tags in this latest version.
      >
      > I dropped the <title> line to just BELOW the </head> line and all my[/color]
      lovely[color=blue]
      > typographers quotes are back in business ha ha.
      >
      > Go figure. ;)
      >
      > Angel[/color]


      However,

      <title></title> belongs between <head> and </head> per W3C:


      7.4.2 The TITLE element
      <!-- The TITLE element is not considered part of the flow of text.
      It should be displayed, for example as the page header or
      window title. Exactly one title is required per document.
      -->
      <!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->
      <!ATTLIST TITLE %i18n>

      Start tag: required, End tag: required

      Attributes defined elsewhere

      lang (language information), dir (text direction)
      Every HTML document must have a TITLE element in the HEAD section.

      Authors should use the TITLE element to identify the contents of a document.
      Since users often consult documents out of context, authors should provide
      context-rich titles. Thus, instead of a title such as "Introducti on", which
      doesn't provide much contextual background, authors should supply a title
      such as "Introducti on to Medieval Bee-Keeping" instead.

      For reasons of accessibility, user agents must always make the content of
      the TITLE element available to users (including TITLE elements that occur in
      frames). The mechanism for doing so depends on the user agent (e.g., as a
      caption, spoken).

      Titles may contain character entities (for accented characters, special
      characters, etc.), but may not contain other markup (including comments).
      Here is a sample document title:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
      "http://www.w3.org/TR/html4/strict.dtd">
      <HTML>
      <HEAD>
      <TITLE>A study of population dynamics</TITLE>
      .... other head elements...
      </HEAD>
      <BODY>
      .... document body...
      </BODY>
      </HTML>




      Comment

      • Eric Bohlman

        #4
        Re: Help? Spec Character Problems w/JAVASCRIPT TOOLTIP

        Curious Angel <byte.this@usa. net> wrote in
        news:MPG.1a5783 05691b21819896a 8@news.intergat e.com:
        [color=blue]
        > Help? Spec Character Problems w/JAVASCRIPT TOOLTIP
        >
        > Hi, I'm experiencing bizarre problems with quote marks that previously
        > displayed properly in a Javascript TOOLTIP I wrote a year ago . . .
        > and now, inexplicably, won't translate (?). The COPYRIGHT text was
        > originally written using Typographers Quotes (in the ALT-0145,
        > ALT-0146, ALT-0147, and ALT-0148 family). For those who don't know
        > what I'm talking about, these are the more stylized "curling" quotes.[/color]

        They're the wrong codes for them, "working" on only some systems.
        [color=blue]
        > When I resurrected this script just this morning, the following
        > happened: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        > - - - - - - - - - - - - - - -
        > <script language="JavaS cript"> <!--
        > var yumyum="COPYRIG HT © 2004 yada yada.\nThe yada yada’s yada, “YADA
        > YADA,” is yada yada yada.";
        >
        > BECAME
        >
        > <script language="JavaS cript"> <!--
        > var yumyum="COPYRIG HT © 2004 yada yada.\nThe yada yada’s yada,
        > “YADA YADA,” is yada yada yada.";[/color]

        Those are in fact the correct HTML character references for curly quotes in
        Unicode. The problem is that scripts aren't parsed as HTML and as a result
        the script is seeing the literal text of the character references instead
        of the actual curly-quote characters. You need to replace them with "\u"
        escapes: \u2019 for the right single quote, \u201c for the left double
        quote, and \u201d for the right double quote.

        Comment

        Working...