Results 1 to 4 of 4

Thread: using quotes in window.status......is it possible?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    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

    pnj

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    Try using "\q" in your string where you want the double quotes.
    "People who think they know everything are a great annoyance to those of us who do."

  3. #3
    Guest
    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>

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537

    super cool

    thanks, I'm gonna use that right now.
    pnj

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width