-1

Im developing a website. I dont have a local environment, my text editor FTPs files to the server. I want CSS changes to update on the webpage without me having to keep refreshing the page. Is there a plug in or javascript code that will refresh the CSS on a web page every second or half second?

I know there are lots of browser plugins like live reload but I have some trouble getting these to work at the best of times, and as im not working locally I dont think any of them will work for me.

3
  • Yikes. The only time I update code on a production server is if it is absolutely required. Even then, I know exactly what changes needs to be made and will update my version control with the made changes. If your computer is able, I would suggest using VirtualBox to create a development environment that somewhat matches your production environment. Do any testing there and manually refresh your page. This is just my opinion.
    – kobaltz
    Oct 18, 2013 at 14:20
  • I normally work locally its just in this instance that I cant. Its a development server not the live site, but its not on my local computer and I have limited control over it.
    – Evanss
    Oct 18, 2013 at 14:46
  • possible duplicate : stackoverflow.com/questions/2024486/…
    – Shekhar
    Oct 18, 2013 at 14:58

2 Answers 2

1

I've never tried this before but it looks like this JS tool might work:

http://cssrefresh.frebsite.nl/

Note: Only CSS-files included before the CSSrefresh-file will be refreshed.

0

Use this javascript to reload every 1 second

<script type="text/JavaScript">
function refreshTimer() {
    setTimeout("location.reload(true);",1000);
}
</script>
</head>
<body onload="refreshTimer();">

</body>
</html>
3
  • My page takes a while to refresh so I need to just refresh the CSS not the whole page.
    – Evanss
    Oct 18, 2013 at 14:47
  • if you have only a portion of the page that uses the css, make the onload call in the div tag of that section
    – Shekhar
    Oct 18, 2013 at 14:53
  • The entire page will be being developed. Is it possible to refresh the CSS without the entire page with JS?
    – Evanss
    Oct 18, 2013 at 15:39

Not the answer you're looking for? Browse other questions tagged .