SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    It seems that the document.write is already outputting a single quote. I'm not quite sure what you're after that you're not already getting.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •