_uniqueHtmlId
Generate an ID suitable for using on tags in this page. --
Function
It is fairly common, especially when doing complex things with _QLButton, to find that you want a
distinct ID for the target of the button, separately for each button on the page. If the _QLButton is
being used with a Thing, you can often use _oid
to create that ID, but otherwise it can be tricky.
So the _uniqueHtmlId
function simply generates a random ID string, suitable for use on the page.
You typically use this something like:
My Things -> _foreach(
_uniqueHtmlId -> +$displayId
""[[_QLButton(label=..., target=$displayId, ql=...)]]
...
<div id="$displayId"></div>
""
)
Note: at the moment, these IDs are generated randomly, so they are not absolutely guaranteed to be
unique -- there is a very small, but non-zero, chance of an ID collision on the page.