Restart ajax on changed update time, remove unused variable.

This commit is contained in:
David Kopf 2012-04-09 10:04:41 -04:00
parent 40bd020394
commit 0612f771c6
2 changed files with 1 additions and 2 deletions

View File

@ -1057,7 +1057,6 @@ PT_THREAD(ajax_call(struct httpd_state *s, char *ptr))
static int iter;
static char buf[128];
static uint8_t numprinted;
uint16_t dt;
PSOCK_BEGIN(&s->sout);
#if WEBSERVER_CONF_PASSQUERY

View File

@ -3,7 +3,7 @@
function e(el){return document.getElementById(el);}
function ls(){try{r=new XMLHttpRequest();}catch(e){alert("Browswer does not support Ajax");return false;}r.open("GET","/ajaxdata.shtml",true);
x=0;r.onreadystatechange=function(){e('date').innerHTML=(new Date()).toTimeString();if(r.readyState>0){j=r.responseText.substr(x);x+=j.length;eval(j);}};r.send(null);}
function tb(x){var t=e('ss');if(x||t.value=="RUN"){t.value="STOP";ls();}else{t.value="RUN";r.abort();}}
function tb(x){var t=e('ss');try{r.abort();}if(x||t.value=="RUN"){t.value="STOP";ls();}else t.value="RUN";}
function s(el,n,max,text){e(el).innerHTML='<table width=504 border=0 cellpadding=1 cellspacing=0>'+'<tr><td width=200>'+text+'</td>'+'<td width='+(10+300*n/max)+' bgcolor="gray">&nbsp;</td>'+'<td width='+(310-300*n/max)+' bgcolor="lightgray">&nbsp;</td>'+'</table>';}
function wt(m){document.title=m;e('v').innerHTML=m;}
function dc(n,d){return n.toFixed(d);}