Reputation: 59
I honestly don't have a clue what to put here... I have searched all over the web and can't seem to find anything useful :(
I am looking to make a website, but then I would like it to update each time I write something in the notepad (or at least when I save it) so I don't have to manually press F5 in my browser each time.
Does anyone know how to do so?
Upvotes: 3
Views: 12932
Reputation: 635
here is a free solution for you you need to:
npm install -g browser-sync
, where npm
is node js package manager, -g
is for globalbrowser-sync
to follow refresh updates in your terminal or command prompt and write the following code browser-sync start --server --files <files which browser-sync wants to follow and refresh for you>
some files like *.html *.css css/*.css *.js
dont put commas in betweenone thing you need to remember is that you need to write the last command every time you want browser-sync
happy codding :)
Upvotes: 2
Reputation: 2970
Prepros solved my problem. PrePros
Server options
and Select External Server
Use External Server
option and paste the Xampp Project Url. Upvotes: 2
Reputation: 493
This is going to refresh your page every 10 seconds or whatever amount of milliseconds you input, but that is usually a bad solution, but it is easy and works! Hope this helps, dont forget to remove or disable it when you are done!
setInterval(function(){location.reload(true);}, 10000);
Upvotes: 1
Reputation: 645
You can build a php script which check if your files are updated then you create an infinite loop or a timed loop on the client side to request this script. If it returns true (updated), you reload your page.
Theoricaly, it works but I discourage you to do it. It will consume a lot of cpu and will not be really usefull...
Upvotes: 0