Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old June 11th, 2008, 07:58 PM   #1
New Member
 

Join Date: Jun 2008
Location: California
Age: 30
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 omega113 is on a distinguished road
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; June 12th, 2008 at 01:00 PM.. Reason: No signature until 25 posts
omega113 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 12th, 2008, 01:07 PM   #2
Aso
Most Reputable Member
 

Join Date: Oct 2007
Location: UK
Posts: 1,633
Blog Entries: 2
Thanks: 22
Thanked 84 Times in 79 Posts
Rep Altering Power: 0 Aso is on a distinguished road
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.
Aso is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse a string... Anonymous User Classic ASP 4 June 6th, 2008 06:16 AM
Javascript problem - unterminated string jitumandalia JavaScript 2 February 14th, 2008 04:43 AM
Get value from SQL string ? VegaLA Classic ASP 5 January 30th, 2008 04:39 AM
Problem with ["] and ['] in javascript string beckkp JavaScript 3 September 13th, 2007 03:20 AM
string capacity Don Logan JavaScript 11 September 23rd, 2006 05:28 PM


Search Engine Optimization by vBSEO 3.2.0 RC8