473,466 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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="JavaScript"> <!--
var yumyum="COPYRIGHT © 2004 yada yada.\nThe yada yada’s yada, “YADA YADA,” is yada
yada yada.";

BECAME

<script language="JavaScript"> <!--
var yumyum="COPYRIGHT © 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
Jul 20 '05 #1
3 2206
In article <MP************************@news.intergate.com>, by*******@usa.net says...
Help? Spec Character Problems w/JAVASCRIPT TOOLTIP


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
Jul 20 '05 #2
"Curious Angel" <by*******@usa.net> wrote in message
news:MP************************@news.intergate.com ...
In article <MP************************@news.intergate.com>, by*******@usa.net says...
Help? Spec Character Problems w/JAVASCRIPT TOOLTIP


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

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 "Introduction", which
doesn't provide much contextual background, authors should supply a title
such as "Introduction 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>

http://www.w3.org/TR/REC-html40/stru...html#idx-title
Jul 20 '05 #3
Curious Angel <by*******@usa.net> wrote in
news:MP************************@news.intergate.com :
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.
They're the wrong codes for them, "working" on only some systems.
When I resurrected this script just this morning, the following
happened: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
<script language="JavaScript"> <!--
var yumyum="COPYRIGHT © 2004 yada yada.\nThe yada yada’s yada, “YADA
YADA,” is yada yada yada.";

BECAME

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


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.
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: fartsniff | last post by:
Hello all. Can someone help out ? I found this PHP code that works just fine, however, I am trying to put it back into its original Javascript form. I am still learning the syntax, etc. for...
13
by: Nicholas Pappas | last post by:
Hello all. I am trying to write a Java3D loader for a geometry file from a game, which has Unicode characters (Korean) in it. I wrote the loader and it works in Windows, but I recently brushed...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
5
by: ZildjianB | last post by:
Hi All, I hope you can help me with this, as I have done some exhaustive searching over the past couple days and cannot find a solution. What I am trying to do is dynamically update an image...
17
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control...
4
by: Cesario | last post by:
I'm trying to display formatted multi-line text in tooltips. It seems that the newline character works fine whereas the 'tab' character is causing problems and can't display properly. More...
4
by: Rusty | last post by:
Hi, I've seen something on a web site that I want to do for our Intranet web site. I'm not advocating pop-ups but for our company app, this would be perfect. Please go to this page and hold...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
19
by: maya | last post by:
hi, so what is "modern" javascript?? the same as "DOM-scripting"? i.e., editing content (or changing appearance of content) dynamically by massaging javascript objects, html elements, etc? ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.