I've been following this technique on css-tricks to add icons to a website: http://css-tricks.com/html-for-icon-font-usage/
I've got this in my CSS:
[data-icon]:before {
font-family: Symbol;
content: attr(data-icon);
speak: none;
}
However, part of my interface is generated using jQuery. Here's one such control:
var $control = $('<div>', {
'aria-hidden':'true'
, 'data-icon': ''
});
I have tried encoding it as \e01c
, \\e01c
, 
, you name it, I've probably tried it. The result is always the same, everything after the ampersand is rendered to the screen because the ampersand comes out as &
in the source code or the backslashes show up.
I tried concatenating in the CSS content:
content: "&" attr(data-icon) ";";
and just including the number in the data but the ampersand still shows up encoded on its own.
Is there any way to encode this entity and have it output to the page correctly?