Bonjour,
J'ai un soucis avec mes fonctions, mon window.status ne fonctionne pas et j'ai un message d'erreur qui me dit que mon mnt est indefini.
<SCRIPT language=javascript>
serveursele=document.forms.formh.serveurs.value;
graph='<embed src="svggen.asp?debut=<%=session("debut")%>&fin=<%=session("fin")%>&vcoef=<%=vcoef%>&tags=<%=tags%>&displayID=<%=displayID%><% for i=1 to nbTagsMax %>&tag<%=i%>=<%=courbes(i).LeTag%><%next%>" width="950" height="<%=60+(100*vcoef)+17*TagToDisplay%>" type="image/svg+xml" name="emap" id="emap"></embed>';
var dt=new Date();
window.status=dt.getHours()+":"+dt.getMinutes()+":"+dt.getSeconds();
if( dt.getSeconds()>=<%=DisplayID+5%> && dt.getSeconds()<=<%=DisplayID+30%>){
document.getElementById('gra').style.display = 'inline';
document.getElementById('phe').style.display = 'none';
document.getElementById("gra").innerHTML=graph;
}else{
document.getElementById('gra').style.display = 'none';
document.getElementById('phe').style.display = 'inline';
document.getElementById("phe").innerHTML=graph;
}
timer('<%=session("fin")%>');
function timer(mnt){
serv=document.forms.formh.serveurs.value;
var dt=new Date();
window.status=dt.getHours()+":"+dt.getMinutes()+":"+dt.getSeconds();
if (dt.getSeconds() == <%=DisplayID+5%>){
fine(serv);
graph='<embed src="svggen.asp?debut=<%=session("debut")%>&fin="+mnt+"&vcoef=<%=vcoef%>&tags=<%=tags%>&displayID=<%=displayID%><% for i=1 to nbTagsMax %>&tag<%=i%>=<%=courbes(i).LeTag%><%next%>" width="950" height="<%=60+(100*vcoef)+17*TagToDisplay%>" type="image/svg+xml" name="emap" id="emap"></embed>';
document.getElementById("gra").innerHTML=graph;
document.getElementById('gra').style.display = 'none';
}
if (dt.getSeconds() == <%=DisplayID+8%>){
document.getElementById('phe').style.display = 'none';
document.getElementById('gra').style.display = 'inline';
}
if (dt.getSeconds() == <%=DisplayID+30%>){
fine(serv);
graph='<embed src="svggen.asp?debut=<%=session("debut")%>&fin="+mnt+"&vcoef=<%=vcoef%>&tags=<%=tags%>&displayID=<%=displayID%><% for i=1 to nbTagsMax %>&tag<%=i%>=<%=courbes(i).LeTag%><%next%>" width="950" height="<%=60+(100*vcoef)+17*TagToDisplay%>" type="image/svg+xml" name="emap" id="emap"></embed>';
document.getElementById("phe").innerHTML=graph;
document.getElementById('phe').style.display = 'none';
}
if (dt.getSeconds() == <%=DisplayID+35%>){
document.getElementById('gra').style.display = 'none';
document.getElementById('phe').style.display = 'inline';
}
setTimeout("timer(mnt)",1000);
}
function fine(i){
xhr = (window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"))
xhr.open("POST", "page02.2.asp", true);
xhr.onreadystatechange = function(){
if(xhr.readyState == 4){
var tmp = xhr.responseText;
timer(tmp);
}
}
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xhr.send("serv="+i);
}
</SCRIPT>
<%
else
%>
<SCRIPT language=javascript>
graph='<embed src="svggen.asp?debut=<%=session("debut")%>&fin=<%=session("fin")%>&vcoef=<%=vcoef%>&tags=<%=tags%>&displayID=<%=displayID%><% for i=1 to nbTagsMax %>&tag<%=i%>=<%=courbes(i).LeTag%><%next%>" width="950" height="<%=60+(100*vcoef)+17*TagToDisplay%>" type="image/svg+xml" name="emap" id="emap"></embed>';
//graph='<embed src="svggen.asp?debut=<%=session("debut")%>&fin=<%=session("fin")%>&vcoef=<%=vcoef%>&tags=<%=tags%>&displayID=<%=displayID%><% for i=1 to nbTagsMax %>&tag<%=i%>=<%=courbes(i).LeTag%><%next%>" width="950" height="<%=60+(100*vcoef)+17*TagToDisplay%>" type="image/svg+xml" name="emap" id="emap"></embed>';
document.getElementById('gra').style.display = 'inline';
document.getElementById("gra").innerHTML=graph;
</SCRIPT>
<%
end if
%>
Ma fonction fine me renvoie la date actuel, mais pour que ça fonctionne j'ai besoin de mon window.status.
Merci