You can use the Tester Panel on the bottom of the Editor Panel (the one with the text input), here's some example of how to use it: Tester Panel
Tip: You can also use that to run/test JavaScript, just enclose it in a Square Bracket.
(Plug) You can also check some of my debugging utilities.
The problem with it is that (I think, I'm not sure), while it reads from left to right and top to bottom, the function
add()
has been called before even the[a]
is resolved. You can fix that by enclosing it in asetTimeout
to wait for the element to be loaded first before adding the new one.Another problem is when you use
<span id="a_elem">\[a.html\]</span>
for the[a]
, upon loading it on the HTML, the\[a.html\]
is gone. It would only have the 'A', so even if you update it, you aren't updating anything (essentially saying that[a.html]
has been evaluated and you are only updating 'A').