I can see in the source that it basically reloads css automatically if you are on localhost, and I can see in the firebug panel that it's requesting the .less file(s) every second.. but when I change something in the files it's not updated on the page unless I do a full refresh.
I also tried using less.refresh() as described here:
https://github.com/cloudhead/less.js/issues/346
But to no avail.
So, how can I reload the .less files without reloading the page?
Thanks
All you have to do is to perform a hard or force-reload or empty the local cache if necessary. If you're using Chrome, you can force reload by pressing the F12 key to open the console. Then, right-click the reload button to access the menu containing the options for reloading.
It works, all the time, for everyone. But, if you're not using it, and you just need to reload that one CSS or JS file occasionally in your own browser... just open it in its own tab and hit SHIFT-reload (or CTRL-F5)!
AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page. Classic web pages, (which do not use AJAX) must reload the entire page if the content should change.
You can use the location. reload() JavaScript method to reload the current URL. This method functions similarly to the browser's Refresh button. The reload() method is the main method responsible for page reloading.
Found the answer to my question here:
https://github.com/cloudhead/less.js/issues/168
Basically had to add a header to prevent caching .less files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With