Meaningless Drivel is fun!*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "javascript special characters" Watch "javascript special characters" New topic
Author

javascript special characters

deva siva
Ranch Hand

Joined: Apr 29, 2005
Posts: 37
Hi

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

regards
deva siva
Eric Pascarello
author
Rancher

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

Eric
deva siva
Ranch Hand

Joined: Apr 29, 2005
Posts: 37
Hi

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: 322
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.
Thanks,
kundan


SCJP1.4,SCBCD,SCEA,CNA
Failures are practice shoots for success.
deva siva
Ranch Hand

Joined: Apr 29, 2005
Posts: 37
Hi

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.

bye
deva
deva siva
Ranch Hand

Joined: Apr 29, 2005
Posts: 37
can u please help me..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javascript special characters
 
Similar Threads
HTML mailto attribute
Reading/Writing Foreign Text
Issue with special characters in javascript
Problem Whit Special Characters on server side
how to encode to avoid javascript error