If you set the innerHTML of a <div> to innerHTML = '<a href='Something/C%23'>C#</a><br />';
What seems to actually get ‘rendered’ is:
<div> <a href='Something/C#'>C#</a><br /> </div>
What is the proper way to escape this so the link will stay ‘Something/C%23’ ?
UPDATE:
I noticed a weird little thing here. If you use a function to build up the link. The extra %25 escaping is not needed. Weird.
ex.
function buildLink(tg, nm) { return '<a href='Something/' + tg + ''>' + nm + '</a><br />'; }
Try this:
Expand the ‘
%‘ to ‘%25‘ and you get what you want. Then the ‘%25‘ is converted back to the percent character and the subsequent23is not reinterpreted.