I have a place which gives fallback picture if a variable is not set to a working image link, and I was wondering if I could make it do more things onerror. Here’s the kind of code I have (which I got from the IFCF) which works:
That uses the semicolon to separate the JavaScript commands to be executed when that event is triggered.
Also, note that, while the widget will be executed, you won’t see any output it tries to print to the screen from that. If that’s what you want, you’ll have to make the widget output anything within a <div>, a <span>, or some similar HTML element, likely using the <<replace>> macro to output the content within the element.