HTML Encoding | Community
Skip to main content
Dragan_Simonski
Level 1
September 24, 2018
Question

HTML Encoding

  • September 24, 2018
  • 1 reply
  • 1085 views

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;"?

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
Level 10
September 24, 2018

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