Re: Need to hard code an apostrophe

by "Abhay S. Kushwaha" <abhay(at)kushwaha.com>

 Date:  Tue, 19 Oct 1999 15:01:12 +0530
 To:  "Basics [HWG]" <hwg-basics(at)hwg.org>
 References:  koyote
  todo: View Thread, Original
Nope. Bobby not at fault. Code at fault. Change code. Bobby give
thumbs up then.

See, just remember a rule of the thumb : when you start a particular
type of encloser-marker, add the ending part there and then -- and
*then* fill out the middle. This stops me from forgetting to put in
the "closing" part of the marker.

Eg: You start your "onMouseOver" after the "=" with a double quote,
    i.e. " but you don't close it down the line. *That* is what is
    causing Bobby to generate the error.

Then, be sure that you 'escape' the special characters. Escaping means
making sure, using a special character called, what else but escape
character, to tell the parser that the following character needs to be
interpreted in a different way from the usual.

Eg: Your apostrophe in 'Bobby's Homepage.' You enclose them properly
    but you need to escape the apostrophe between "y" and "s" using
    a "\".


So, in the end, just modify the text from:

onMouseOver="self.status='Bobby's Homepage '; return true

to

onMouseOver="self.status='Bobby\'s Homepage '; return true"

and party and be merry. ;-)

[abhay]

----- Original Message -----
From: Billy <woppel(at)netexas.net>
Sent: Tuesday, October 19, 1999 8:29 AM


> <LI><a href="http://www.somewhere.com/tfelms/"
> onMouseOver="self.status='Bobby's Homepage '; return true>Bobby</a>
>
> Doesn't work!!!!  The apostrophe in Bobby's is causing this
> line to close early.
>
> I know the escape code for an apostrophe is &#39;, but how do
> I put it in the line where it will work?
>
> I tried ='Bobby&#39;s Homepage' and ='Bobby &#39; s Homepage',
> but neither would work........

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA