2

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!

Kenny83
  • 769
  • 12
  • 38
  • Find an answer @Kenny83 : https://stackoverflow.com/questions/9642205/how-to-force-a-script-reload-and-re-execute – TERMINATOR Mar 27 '21 at 12:21
  • P.S Hope it helps, If I had more time I would definitely give an answer myself after intense research – TERMINATOR Mar 27 '21 at 12:21
  • Fair point, I *have* failed to do a lot of research on the subject and was hoping for a quick and easy answer, even if it was just a subjective opinion. Since such questions are generally discouraged on SO, I should probably go back to Google and leave you fine folks alone :-) Thanks again for trying to help! – Kenny83 Mar 27 '21 at 12:22
  • Sorry for my adjitated response I have since deleted it , I wish you good luck – TERMINATOR Mar 27 '21 at 12:23
  • 1
    Thanks mate, I too apologise for reacting a bit snarkily to your first comment. Have a great day/night! – Kenny83 Mar 27 '21 at 12:24

0 Answers0