I had a couple of very useful old javascript snippets from you way back in the early days.
One sets ID='identifier' on web items so that they can be styled by Annex using CSSID$("identifier",
The other sets onclick='cmdButton(this)' to branch to the subdir specified by data-var='subdir'
Both work great by themselves.
I could create an alternatively styled LED which could be toggled by a button.
OR Annex could branch by clicking on that LED.
BUT (big BUT) they don't work together, cos the on-click facility breaks style capability.
The problem has been there for ages, so is not a recent introduction, and is the same for Annex and Annex32. Is not the end of the world, but would be nice to click an led to toggle its relay, or click on a textbox to get new info, rather than needing to include buttons for them.
It's not easy to explain in words, but is demonstrated in the snippet below - the button shows the mylamp styling is working and toggling the mylamp variable. But if the on-click line is uncommented, it then prevents any styling even though on-click does branch and toggles the mylamp variable.
Hopefully the problem may quickly jump out when looked for, and might be something to do with LED code seeing as how the ID items styling colour is being over-ridden to green.
Code: [Local Link Removed for Guests]
'onclick styling snippet
mylamp = 0
cls
autorefresh 1000
a$= "<svg height='20' width='30'><circle cx='15' cy='12' r='8' stroke='black' fill='darkgray' id='mylamp'"
'a$=a$ + "data-var='toggle' onclick='cmdButton(this)'" 'this does branch ok, but screws up ID=
a$=a$ + " /></svg>"
a$=a$ + CSSID$("mylamp", "fill: cyan;")
a$=a$ + "<br><br><br>"
a$=a$ + textbox$(mylamp)
a$=a$ + "<br><br><br>"
a$=a$ + button$("toggle",toggle)
html a$
wait
toggle:
mylamp = 1 - mylamp
if mylamp = 1 then css CSSID$("mylamp", "fill: yellow;") else css CSSID$("mylamp", "fill: blue;")
return