[Javascript] apostropes... '

Andrew Gibson andyg at ihug.co.nz
Sun Apr 8 15:41:52 CDT 2001


Thanks Bekim, my problem was that I was having
to mix ASP code with Javascript
response.write "clientname["& x &"]='O'Reilly'" &vbcrlf

I solved it by using a couple of prewritten strings and parsed it that way.

Thanks again Jeff and Bekim.

Andrew

  -----Original Message-----
  From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
Behalf Of BEKIM BACAJ
  Sent: Monday, April 09, 2001 12:45 AM
  To: javascript at LaTech.edu
  Subject: Re: [Javascript] apostropes... '


  That was a correct answer, but it doesn't work with strigs,
  because strings are interpreted literaly, there are other ways to work
that out.
  Why don't you try another aproach?
  Make you're VAR global by declaring it as
  var myname=""
  outside of any function,

  Write a function that change's the value of  variable - mymame,
  and read you're value, for instance some input and say:
  {myname=the_ID_of_the_input.value}
  and refer to it, with:
  eval(myname)
  this way the myname variable will allways have an updated name, the most
recently entered in the field.
  Regards!


    ----- Original Message -----
    From: Andrew Gibson
    Sent: Sunday, April 08, 2001 7:44 AM
    To: javascript at LaTech.edu
    Subject: RE: [Javascript] apostropes... '


    Thanks Jeff, I tried this though and it didn't
    work.....

    eval ("var myname='O\'Relly'");
    alert (myname);

    > > How do I deal with ' in a person name
    > >
    > > eval ("var myname='ORelly'")
    > > is ok
    > > but what about
    > >
    > > eval ("var myname='O'Relly'")
    >
    > eval ("var myname='O\'Relly'")
    >
    > Jeff
    >
    > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    > Jeff Walters   (314) 962-4024
    >
    > Cybermill Communications
    > 8616 Joseph Ave
    > St. Louis, MO 63144
    > Jeff at cybermill.com
    > http://www.cybermill.com/
    >
    >
    > _______________________________________________
    > Javascript mailing list
    > Javascript at LaTech.edu
    > http://www.LaTech.edu/mailman/listinfo/javascript
    >

    _______________________________________________
    Javascript mailing list
    Javascript at LaTech.edu
    http://www.LaTech.edu/mailman/listinfo/javascript




----------------------------------------------------------------------------
--
  Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010409/89d35c01/attachment.htm>


More information about the Javascript mailing list