Too Many Quote Marks

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • OC

    Too Many Quote Marks

    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~


  • Jim McMaster

    #2
    Re: Too Many Quote Marks


    "OC" <oc@sc.rr.nonon ono.com> wrote in message
    news:jSnrc.5246 6$V_.2184376@tw ister.southeast .rr.com...[color=blue]
    > 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.[/color]

    Precede the apostrophe with a backslash:

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

    --
    Jim McMaster
    mailto: jim.mcmaster@co mcast.net


    Comment

    • OC

      #3
      Re: Too Many Quote Marks

      "Jim McMaster" <jim.mcmaster@c omcast.net> wrote in message
      news:ScGdnRlFJe sYjTPdRVn-hg@comcast.com. ..[color=blue]
      >
      > "OC" <oc@sc.rr.nonon ono.com> wrote in message
      > news:jSnrc.5246 6$V_.2184376@tw ister.southeast .rr.com...[color=green]
      > > 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[/color][/color]
      keep[color=blue][color=green]
      > > the apostrophe? Thanks for your help.[/color]
      >
      > Precede the apostrophe with a backslash:
      >
      > document.write( 'TJ\'s Restaurant');
      >
      > --
      > Jim McMaster
      > mailto: jim.mcmaster@co mcast.net
      >[/color]

      Worked great. Thank you!!
      ~OC~


      Comment

      • Ken Smith

        #4
        Re: Too Many Quote Marks

        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.nonon ono.com> wrote in message
        news:jSnrc.5246 6$V_.2184376@tw ister.southeast .rr.com...[color=blue]
        > 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~
        >
        >[/color]


        Comment

        Working...