[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: use a gambas web cgi in a phpBB forum
[Thread Prev] | [Thread Next]
- Subject: Re: use a gambas web cgi in a phpBB forum
- From: Lee <t.lee.davidson@xxxxxxxxx>
- Date: Sat, 29 Nov 2025 23:59:39 -0500
- To: user@xxxxxxxxxxxxxxxxxxxxxx
On 11/29/25 7:57 PM, Bruce Steers wrote:
Doh! I hadn't thought of that either. Good result though. Your js is way better than mine was. Maybe something like a timestamp... var id = "bbcode_" + Date.now()
So you're suggesting creating a unique id for the SPAN element of the bbcode's HTML replacement? That might work if doable. There are two problems I see with using JavaScript: timing, and finding the appropriate location in the DOM tree.If the SPAN element is given an initial id statically and the bbcode attempts to change it, timing could cause collisions with other id's with the same value.
On the other hand, if the SPAN element is created dynamically, how is it placed correctly in the DOM? The parent of the current post content (the DIV) must be determined as that has a unique id. But, Element.parentElement is not available unless a listener is triggered, usually in an onClick event. For example, "<span id="code">{TEXT}<script>this.innerText=this.ParentNode.nodeName;</script></span>", does not work.
-- Lee --- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ---- --- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----
| use a gambas web cgi in a phpBB forum | Bruce Steers <bsteers4@xxxxxxxxx> |
| Re: use a gambas web cgi in a phpBB forum | Lee <t.lee.davidson@xxxxxxxxx> |
| Re: use a gambas web cgi in a phpBB forum | Bruce Steers <bsteers4@xxxxxxxxx> |
| Re: use a gambas web cgi in a phpBB forum | Lee <t.lee.davidson@xxxxxxxxx> |
| Re: use a gambas web cgi in a phpBB forum | Bruce Steers <bsteers4@xxxxxxxxx> |
| Re: use a gambas web cgi in a phpBB forum | Lee <t.lee.davidson@xxxxxxxxx> |
| Re: use a gambas web cgi in a phpBB forum | Lee <t.lee.davidson@xxxxxxxxx> |
| Re: use a gambas web cgi in a phpBB forum | Lee <t.lee.davidson@xxxxxxxxx> |
| Re: use a gambas web cgi in a phpBB forum | Bruce Steers <bsteers4@xxxxxxxxx> |