1

With CodeKit, when I'm working on a CSS file referenced on my HTML page via a link tag, every time I save that CSS, CodeKit autoupdates the page to show my changes.

When I do the same to a JS file referenced via a script tag on my head, it doesn't. I save the JS, and although it works if I manually reload the HTML on the browser, it doesn't automatically reloads for me like it does with CSS files.

Is this intended? Is there a way to make it autoreload?

Thanks!

Fabio Bracht
  • 423
  • 1
  • 4
  • 13
  • Short Answer: Its not possible. – r3wt Sep 29 '15 at 00:18
  • 2
    Long Answer: When you load a webpage, the script tags are loaded and executed. Removing the script tags have no effect on the code running on the webpage. it will still exist in memory. you could delete the script tag and reload it with a querystring, but this causes memory leaks unless you structure your code inside of a giant object that gets overwritten by the new code. so yeah, technically possible, definitely inadvisable, you should not attempt it. – r3wt Sep 29 '15 at 00:22
  • Thank you! Please submit it as an actual answer below so I can upvote and accept it. :) – Fabio Bracht Sep 29 '15 at 00:49
  • Hmm... I use CodeKit and if I save JS file it reloads the page correctly. Maybe your JS files don't belong to project in Codekit? – max Oct 16 '15 at 22:26

1 Answers1

0

Both the script and HTML are different files, and changes to the script will not affect changes to the HTML code.

Sir Cumference
  • 214
  • 5
  • 19
  • You could also say that both the css and the html are different files, nevertheless saving one does autoupdate the other. It's actually one of the main CodeKit features. – Fabio Bracht Sep 29 '15 at 11:54