6

live.js sending consecutive HEAD requests to the server and if there is a change in the html, css or js file, live.js refreshing the data.

It's very simple Just link the file to the html file

<script type="text/javascript" src="live.js">

It works well if the files on a server but if I'm working on a local computer with notepad It does not work.

Does anyone know why and how to fix it?

Dany Maor
  • 2,303
  • 2
  • 17
  • 25

1 Answers1

7

In general, live.js does not support the file protocol. However, there is a very easy work-around (suggested by @MarcelValdezOrozco in a comment to this answer):

If you have Python installed, you can start a local webserver simply by running

$ python -m SimpleHTTPServer

Run it in the same directory as your HTML file. By default, the server will list the content of the directory. Navigate to your HTML. Now auto-reloading using live.js should work.

Community
  • 1
  • 1
bluenote10
  • 20,013
  • 11
  • 98
  • 156