[Javascript] If a string contains many ' and ", how to dealwithit injavascript?

Dan Costea costea.dan at ssi-schaefer.ro
Tue Jul 1 10:04:04 CDT 2003


HELLO?? I told you to be more specific. Your code is WRON!

<input type='text' value=str>

will give you an editbox with "str" written in it!


Tell us what you want and you might be helped!

if you want to populate an editbox, try this:
  <script type="text/javascript">
   function testing ()
   {
    var ohMyInput = document.getElementById ("lala");
    ohMyInput.value = "this is a 'test' and \"double quote\"";
   }
  </script>


   <button onclick="testing ();">just testing</button>
   <br/>
   <input type='text' id="lala">


If you want something else, BE SPECIFIC.

----- Original Message -----
From: <alwang at micron.com>
To: <javascript at LaTech.edu>
Sent: Tuesday, July 01, 2003 6:49 PM
Subject: RE: [Javascript] If a string contains many ' and ", how to
dealwithit injavascript?


> I tried it, seems it can not work quite well in javascript.
> for example:
>
> str = "this is a 'test' and \"double quote\"";
> <input type='text' value=str>
> will just show
> this is a 'test' and \
>
> Any good idea?
> Thanks,
> Alex.
>
>
> -----Original Message-----
> From: Dan Costea [mailto:costea.dan at ssi-schaefer.ro]
> Sent: Tuesday, July 01, 2003 8:40 AM
> To: [JavaScript List]
> Subject: Re: [Javascript] If a string contains many ' and ", how to deal
> withit injavascript?
>
>
> str = "the string can have ' and \" too.";
> alert (str);
>
> If you need more, please be more specific.
>
> Regards,
> Dan.
>
>
> ----- Original Message -----
> From: <alwang at micron.com>
> To: <javascript at LaTech.edu>
> Sent: Tuesday, July 01, 2003 6:34 PM
> Subject: [Javascript] If a string contains many ' and ", how to deal with
it
> injavascript?
>
>
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list