The onerror attribute is not allowed to prevent messing with scripts too easely, you could use a div with a style attribute to display an image without the default fallback image:
Thanks. This solution would have worked on a static button which always looks the same. However I failed to mention that the buttons I talk about are dynamic: a single dynamic button replaces any number of static buttons. This dynamic button frequently changes its appearance and function as if it were a different button each time.
Most buttons will not contain an image. But how to prevent the html code for image insertion to be executed? I don’t know if that’s possible. Conditional statements are not allowed in html afaik.
I have found a solution in which I just leave the image alone. Instead I make it completely transparant.
So when the button doesn’t contain an image, the ‘broken link’ symbol must be set to fully transparant which makes it invisible:
.imageStyle{
opacity: 0;
}
If on the other hand there is an image to be shown, the opacity should be something like 0.7
I retrieve .7 from a matrix with this code: #{@{buttonArray2}[VAR{buttonNumber}][20]}};