This is a discussion on "Decoding a string in Javascript" within the JavaScript Forum section. This forum, and the thread "Decoding a string in Javascript are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Decoding a string in Javascript
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Decoding a string in Javascript
I am having a hard time in decoding this string in javascript
' I am using the following code _______________________ text="'"; var output=text.unescapeHTML(); document.write(output); _______________________ It shows ' I would like to decode it further to just a single quote since entity code for single quote = ' I tried to use the above function in a for loop but still it gives me same result. Any help would be greatly appreciated Anuj Last edited by Aso; Jun 12th, 2008 at 16:00. Reason: No signature until 25 posts |
|
|
|
#2
|
||||
|
||||
|
Re: Decoding a string in Javascript
Correct me if I'm wrong, but I think unescape only works with url encoded characters.
Instead, I think you're looking for something like this - script to convert HTML entities.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reverse a string... | Anonymous User | Classic ASP | 4 | Jun 6th, 2008 09:16 |
| Javascript problem - unterminated string | jitumandalia | JavaScript Forum | 2 | Feb 14th, 2008 07:43 |
| Get value from SQL string ? | VegaLA | Classic ASP | 5 | Jan 30th, 2008 07:39 |
| Problem with ["] and ['] in javascript string | beckkp | JavaScript Forum | 3 | Sep 13th, 2007 06:20 |
| string capacity | Don Logan | JavaScript Forum | 11 | Sep 23rd, 2006 20:28 |