HTML Encoding

Level 1

HTML Encoding

Hi All,
I suppose not being he first one having this problem, if someone knows more about, it will be a great help.
For the needs of my customer, I have to implement a custom tracking for landing page visits and clicks to one link only.

The custom tracking should be made this way:

<button type="button" ="return window.adf&&adf.ClickTrack(this, {trackingId}, 'Name', {});">Click Here!</button>

The problem is that the double amersand in the  is converted to &amp;&amp; in the rendered page and the  event handler is not executed.

Any idea how to prevent the "&&" conversion to "&amp;&amp;"?


Level 10 - Community Moderator

Re: HTML Encoding

Ampersands in attribute values should be HTML encoded. That's not an error, it's the correct way to output HTML.