views:

126

answers:

4

Hi I am converting one layout to html , once I make the changes in code html/css then every time I have to hit F5. is there any simple javascript/ jQuery solution for this.

like i add the script and its reload the whole page every 5(or specific time)

thanks

+3  A: 
setTimeout(function () { location.reload(1); }, 5000);

But as development tools go, you are probably better off with https://addons.mozilla.org/en-US/firefox/addon/115

David Dorward
+9  A: 
 <meta http-equiv="refresh" content="5; URL=http://www.yourdomain.com/yoursite.html"&gt;

If it has to be in the script use setTimeout like:

setTimeout(function(){
   window.location.reload(1);
}, 5000);

Kind Regards

--Andy

jAndy
@jAndy: Just FWIW, signatures are frowned upon here. (If you look around, you'll see virtually no one uses them.) This is because of the nature of SO; the goal is good answers to good questions, frequently collaboratively, rather than a discussion group style site. (How frequently we *reach* that goal is another question, but...)
T.J. Crowder
I think this is probably a better way of doing it than in javascript.
Rich
affirmative....
jAndy
If the use case was that the page needed to refresh for visitors then I might agree, but for development purposes, having a block of code that you can drop into the page without having to update a URI each time is an advantage. Depending on JS isn't a problem when the developer is the entire target audience.
David Dorward
@ T.J. Crowder : when you say signature, do you mean the way he's personalised his icon?
Rich
+1  A: 

A decent alternative if you're using firefox is the XRefresh plugin. It will reload your page everytime it detect the file has been modified. So rather than just refreshing every 5 seconds, it will just refresh when you hit save in your HTML editor.

Mailslut
A: 

If you are developing and testing in Firefox, there's a plug-in called "ReloadEvery" is available, which allows you to reload the page at the specified intervals.

Veera
yes, I used that. but js/html would be fine.
Wazdesign