-
hey,
I am just curious......
I am writing to the status bar and would like to use a
single quote like "joe's coffee"
but when I do, javascript sees the single quote in joe's name and gets confused about [s coffee].
here is my code
*********************
<a href="" onMouseover="(document.bgColor='#333333'); (window.status='joe's coffe') ; return true ;" onMouseout="(document.bgColor='#cccccc'); (window.status=''); ")>Boo</a>
**********************
if this is possible let me know how.
if not no biggie.
if I confused you let me know and I'll try and re-word my question.
thanks
-
Try using "\q" in your string where you want the double quotes.
-
That doesn't work.. :(
You have to escape the quotes themselves:
Code:
<SCRIPT LANGUAGE="JavaScript">
window.status="\"hello\"";
</SCRIPT>
You do the same for single quotes:
Code:
<SCRIPT LANGUAGE="JavaScript">
window.status='Joe\'s Coffee';
</SCRIPT>
-
super cool
thanks, I'm gonna use that right now.