473,394 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Javascript: text converting into ASCII codes

Hello frens,

Its really a gr8 network community. Ususlly i get the response really in very small time. Today again i am having small doubt :-)

Actually i am working on an application built using j2ee/java struts/java script.
Here, i have set some names in the view bean say "king's kingdom". Now when i am trying to use this name from the viewbean on the jsp using the javascrip , it is getting changed to something like this "king's kingdom" and the text "Harvey on Industrial Relations & Employment Law Cases" is getting changed to "Harvey on Industrial Relations & Employment Law Cases". Can anyone please help me so that i can display the original text to the user.
Jan 15 '08 #1
5 1611
acoder
16,027 Expert Mod 8TB
How are these values entered and stored in the first place? Can you show the JavaScript code?
Jan 15 '08 #2
How are these values entered and stored in the first place? Can you show the JavaScript code?
Hi Acoder,

i am setting these values in my action class in the view bean as a list of the some object. and this object carries these texts. Now in my jsp i am iterating on the viewbean list and storing the contents in javascript object something like this:

arr[0] = new searchSource("name1 having appostrophysay King's Kingdom from viewbean");
arr[0] = new searchSource("second name from viewbean");

here searchSource is a javaScript object as follows
function searchSource(name){
this.name = name;
}

now i am trying to show these names from this object into the option tag of a select tag as folllows:

document.getElementById('idOfSelectTag").options[0] = arr[0].name;

now here, what i see in the option of the select as the ASCII conversion of the appostrophy(') as told above post.
Jan 15 '08 #3
acoder
16,027 Expert Mod 8TB
You could try using the encode/decode functions, e.g. encodeURIComponent.
Jan 16 '08 #4
You could try using the encode/decode functions, e.g. encodeURIComponent.
Hey ,
Acoder
Still the issue is not resolved. The apostrophy ' is converting into "&hash039;s" and "&" converting into &amp
Feb 18 '08 #5
acoder
16,027 Expert Mod 8TB
I don't see this problem. Can you give a sample page which demonstrates the problem? Does this affect all browsers or one particular one?
Feb 18 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Karl-Hugo Weesberg | last post by:
The evil AI creates virus and worm programs to conquer the internet and turn humans into slaves. Throw away javascript, fast, or your brain will be damaged beyond repair!
13
by: Randell D. | last post by:
Folks, I have two related questions: 1. I have seen unicode being mentioned in my javascript pocket book - is this the same as ascii codes? I think not though I'm not sure and I can't find...
3
by: JSM | last post by:
Hi, I am just trying to port an existing simple encryption routine to C#. this routine simply adds/substracts 10 ascii characters to each character in a text file (except quotes). The routine...
2
by: Gidi | last post by:
Hi, I'm writing a C# win application program, and i need to transfer my hebrew letters from unicode to ascii, now if i use the ascii encoding it writes me ??? instead of the hebrew letter i've...
13
by: scorpion53061 | last post by:
This is really weird. I have provided to a client a means for which they can store text in a database and insert into a word document. Originally they entered the text into a textbox. However...
26
by: Patient Guy | last post by:
Has anyone written code that successfully manipulates binary file data using Javascript? It might---and in the case of doing I/O, will---make use of browser- specific functions (ActiveX/COM with...
16
by: namemattersnot | last post by:
re, I have the following problem: links containinig cyrillic characters do not display by the javascript. server-side PHP script encodes them with rawurlecode() function and everything works...
31
by: Claude Yih | last post by:
Hi, everyone. I got a question. How can I identify whether a file is a binary file or an ascii text file? For instance, I wrote a piece of code and saved as "Test.c". I knew it was an ascii text...
3
by: Billy Smith | last post by:
I'm trying to write a little utility that will write some binary data to a file via a javascript and Windows Script Host under Windows XP. The only way to do this that I can find is to convert...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.