Javascript Auto Refresh Toggle Checkbox -


I want my visitors to be able to refresh an auto page with a checkbox (no iframe).
This is the most common code meeting on Google, but it was created in 2004 and I can not seem to work on it
I am using this code on WordPress. So the problem can be in "timerRefresh.htm"? Below is checked "", I do not know its name change, because my WP page Does not end with html / .php / etc ... This is just a "/" "PS I know that there are browser extensions for auto-reloading, I'm not looking for it.

  var asdf = false; function start time () (if (asdf) claritimet (asdf) asdf = setTimeout ("refresh page ()", 5000);} function Refresh page () {Clear timeout (asdf) if (document.Test.CB1.checked) document.location.href = "timerRefresh.htm? Checked"} function load page () {var findCheck = document.location.href.split ("Chec"); if (findCheck.length == 2) {Document.Test.CB1.checked = true; starttime ()}}   

a

  body onload = "LoadPage ()" & Gt; a & lt; form name = "test"> input type = "checkbox" name = "CB1" onclick = "initial ()" & gt; a & lt; / form & gt; & lt; / Body & gt;    

Try it out:

HTML:

  & lt; Input type = "checkbox" onclick = "toggle auto refresh (this);" Id = "reloadCB" & gt; Auto Refresh   

Javascript:

  var is being reloaded; Function check reloading (if (window.location.hash == "# autoreload") {reload = setimout ("window.location.reload ();", 5000) ;. Document.getElementById ("reloadCB") Correct =;}} function toggle auto refresh (CB) {if (cb.checked) {window.location.replace ("# autoreload"); reloading = settimeout ("window.location.reload ();" , 5000);} other {window.location.replace ("#"); clearTimeout (reload);}} Window.onload = checkReloading;    

Comments