quotes within quotes
In Javascript, what can you do about the fact that Netscape has trouble with quotes inside quotes? What does the character "\" mean? Does that just mean see the following character for what it is rather than interpreting it as part of Javascript? (I hope that question made sense.) - Phyllis
Lloyd Hassell posted this at 05:06 — 4th April 2000.
They have: 231 posts
Joined: Feb 2000
You are right. The backslash is used when you want to embed special characters. The character comes after the backslash.
\n = new line
\' = quote
\" = double quote
So if you have a string with a quote in it use this:
var htmlStr = "You said \"Hello\".";
:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::
phyllis posted this at 13:26 — 4th April 2000.
They have: 59 posts
Joined: Mar 2000
Thanks! I had put a bunch of those into a long string of text that had quotes in it, but I had begun wondering if I was using them wrong. -Phyllis
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.