470,636 Members | 1,427 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Too Many Quote Marks

OC
Help please.... My website doesn't like the following line of code:

document.write('TJ's Restaurant');

Seems to be due to the apostrophe in TJ's. How can I fix it and still keep
the apostrophe? Thanks for your help.
~OC~
Jul 23 '05 #1
3 1135

"OC" <oc@sc.rr.nononono.com> wrote in message
news:jS********************@twister.southeast.rr.c om...
Help please.... My website doesn't like the following line of code:

document.write('TJ's Restaurant');

Seems to be due to the apostrophe in TJ's. How can I fix it and still keep
the apostrophe? Thanks for your help.


Precede the apostrophe with a backslash:

document.write('TJ\'s Restaurant');

--
Jim McMaster
mailto: ji**********@comcast.net
Jul 23 '05 #2
OC
"Jim McMaster" <ji**********@comcast.net> wrote in message
news:Sc********************@comcast.com...

"OC" <oc@sc.rr.nononono.com> wrote in message
news:jS********************@twister.southeast.rr.c om...
Help please.... My website doesn't like the following line of code:

document.write('TJ's Restaurant');

Seems to be due to the apostrophe in TJ's. How can I fix it and still keep the apostrophe? Thanks for your help.


Precede the apostrophe with a backslash:

document.write('TJ\'s Restaurant');

--
Jim McMaster
mailto: ji**********@comcast.net


Worked great. Thank you!!
~OC~
Jul 23 '05 #3
You could also just flip between using single or double quotes:

i.e:
document.write("Ken's");
document.write('Ken"s');

This werks 2.

"OC" <oc@sc.rr.nononono.com> wrote in message
news:jS********************@twister.southeast.rr.c om...
Help please.... My website doesn't like the following line of code:

document.write('TJ's Restaurant');

Seems to be due to the apostrophe in TJ's. How can I fix it and still keep
the apostrophe? Thanks for your help.
~OC~

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

63 posts views Thread by Tristan Miller | last post: by
9 posts views Thread by Wayfarer | last post: by
9 posts views Thread by Marek Mänd | last post: by
???
1 post views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.