File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes javascript special characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "javascript special characters" Watch "javascript special characters" New topic

javascript special characters

deva siva
Ranch Hand

Joined: Apr 29, 2005
Posts: 37

In my string/var/textarea contains special characters like ' " $ !, but javascript does not support the special character.

I want to allow this characters. because in my text area contains messages just like notice board. it's contains ' " ! and $ symbols.

but when i pass this text to another page or update text, it gives a javascript error like object doesnot support.

can u pls help me. regarding this issue

deva siva
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
You most likely need to escape the characters.

deva siva
Ranch Hand

Joined: Apr 29, 2005
Posts: 37

Thaks for your response,

can u pls give me the details how to use...
And one more doubt, While entering a message by typing it in text area, if we press enter to get text on next line it does not show the text on the next line when refreshed.

can u pls help me..!

devasiva p.amujuri
kundan varma
Ranch Hand

Joined: Mar 08, 2004
Posts: 323
Hi Deva,
What language you are using for updating or sending to different page? If java then you need to escape character in java while retrieving.

Failures are practice shoots for success.
deva siva
Ranch Hand

Joined: Apr 29, 2005
Posts: 37

here iam using jsp and javascript,
1.adding the message on textarea
2.pass this value to jsp page by using javascript function.
3. and capture that value in jsp while diplaying this it's take a single line text

ex: iam adding messge like: this is test message
please ignore it.
but while diplaying the message another page in text area it displays like
this is test messageplease ignore it.

can u please help me, i want multiple lines.

deva siva
Ranch Hand

Joined: Apr 29, 2005
Posts: 37
can u please help me..
I agree. Here's the link:
subject: javascript special characters
jQuery in Action, 3rd edition