0

I am reading data from a json file and the titles of the key/value pairs are appearing with html entities such as ®/& etc. Although the browser should convert these on the fly but I guess the way I am reading the json document through jquery, it does not do it.

So instead of giving me symbols for these, it is actually displaying the ® etc. how do i correct this?

1
  • Is there a specific reason you don't want them to be HTML encoded? If you're writing them to your document, then they should be HTML encoded. Commented Dec 2, 2011 at 11:33

2 Answers 2

1

Don't handle them as plain text: handle them as HTML. In jQuery, that normally implies using .html() rather than .text() or .val().

Sign up to request clarification or add additional context in comments.

Comments

0

I guess you should encode the text before you write it into the file.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.