4 ms·
> There is one little quirky js thing you can do to get the script element from inside the script. Now you *have* to elaborate. And what's the problem it solve
by Eduard 3y ago
> There is one little quirky js thing you can do to get the script element from inside the script.
Now you *have* to elaborate. And what's the problem it solves?
- 8n4vidtmkvmk 3y agoI think it's just document.currentScript I used it years ago because we had an XML based templating engine and some "components" needed to inject little scripts to add functionality. I could have given everything unique IDs but this was more fun. Forget what I did with it but I need to know where it was in the DOM or something.