[Javascript] apostropes... '

BEKIM BACAJ Trojani2000 at hotmail.com
Sun Apr 8 07:44:32 CDT 2001


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<br clear=all><hr>Get Your Private, Free E-mail from MSN Hotmail at <a href="http://www.hotmail.com">http://www.hotmail.com</a>.<br></p>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010408/152cc7f7/attachment.htm>


More information about the Javascript mailing list