How to get a Clean String in Javascript?

Posted by streetparade on Stack Overflow See other posts from Stack Overflow or by streetparade
Published on 2010-04-27T08:18:10Z Indexed on 2010/04/27 8:23 UTC
Read the original article Hit count: 289

Filed under:
|
|

i have a long String. With some German characters and lots of new lines tabs ect.. In a Selectbox user can select a text, on change i do

document.getElementById('text').value=this.value;

But this fails. I just get a "unterminated string literal" as error in JavaScript.

I think i should clean the string.

How can i do it in JavaScript?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex