PDA

Click to See Complete Forum and Search --> : using quotes in window.status......is it possible?


pnj
Oct 4th, 2000, 01:32 PM
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

noone
Oct 4th, 2000, 08:21 PM
Try using "\q" in your string where you want the double quotes.

Oct 5th, 2000, 07:16 AM
That doesn't work.. :(

You have to escape the quotes themselves:


<SCRIPT LANGUAGE="JavaScript">
window.status="\"hello\"";
</SCRIPT>


You do the same for single quotes:



<SCRIPT LANGUAGE="JavaScript">
window.status='Joe\'s Coffee';
</SCRIPT>

pnj
Oct 5th, 2000, 09:21 AM
thanks, I'm gonna use that right now.