I'm looking for a solution similar to the one described in the answers to How to force a script reload and re-execute?, but I'd preferably like to have a button on my page that does this when clicked.
In other words, I'd like to have a button that when clicked, grabs the newest version of some_script.js
that I just saved in VS Code, and injects it into the page. The process would also need to run $.off
against all event handlers currently attached to the DOM from the old version of some_script.js
, and attach the new ones dynamically.
Even better would be a way that I can have the browser do this automatically when I save some_script.js
in VS Code. All without having to request the entire page.
Is this possible, and if so, do any VS Code extensions already exist for this? MTIA :-)
EDIT: Just realised I should have Googled my question before posting here...https://github.com/tjwalch/django-livereload-server looks like a potentially-good solution, but does anyone here have experience with it? If so, I'd love to hear what you think!