Modify ↓
Ticket #9843 (closed bug: worksforme)
html() method can't handle HTML encoded characters [ampersand-style]
| Reported by: | shehriyari | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | manipulation | Version: | 1.6.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
HOW TO REPEAT:
Let's say we have following piece of code:
var someVar = "<b>"Don&39;t!"</b>;
jQuery("#someDiv").html(someVar);
EXPECTED BEHAVIOUR:
#someDiv gets following content: <b>"Don&39;t!"</b>
WHAT HAPPENS:
Instead #someDiv gets following content: <b>"Don&39;t!"</b>
As you can see, html() method handles ampersand-and-numbers-encoded-special-characters the way text() method does/should. " character is rendered correctly, but &39; is not!
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Sample code @JsFiddle:
http://jsfiddle.net/GRwP7/