1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| <html>
<HEAD>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
<meta http-equiv="Expires" content="0" />
<SCRIPT LANGUAGE="JavaScript">
<!--
var delai_raf_image = 1 ;
var delai_raf_imageOnerror = 1 ;
var timeoutID ;
var new_graph = new Image ;
var partie_zoom ;
var partie_text ;
function refresh_src()
{
new_graph.src = "graphe/test.png" + "?parm_bidon=" + Math.random() ;
//new_graph.src = "graphe/courbe_instantanee.php" + "?parm_bidon=" + Math.random() ;
}
new_graph.onload = function()
{
partie_zoom.innerHTML = '' ;
partie_zoom.style.backgroundImage = 'url(' + new_graph.src + ')' ;
partie_text.innerHTML = new_graph.src ;
timeoutID = window.setTimeout("refresh_src()",delai_raf_image);
}
new_graph.onerror = function()
{
partie_zoom.style.backgroundImage = '' ;
partie_zoom.innerHTML = 'Erreur de communication avec le serveur.' ;
timeoutID = window.setTimeout("refresh_src()",delai_raf_imageOnerror);
}
//-->
</SCRIPT>
<STYLE type="text/css">
<!--
#partie_zoom { border : 1px solid red ; height : 500px ; background-position : top left ; background-repeat : no-repeat ; }
-->
</STYLE>
</HEAD>
<body onload="JavaScript:refresh_src();" >
<h1>Affichage temps reel</h1>
<div id="text"></div>
<div id="partie_zoom"></div>
<a onClick="javascript:clearTimeout(timeoutID);return false;" href="#;" >Arreter</a>
<a onClick="JavaScript:refresh_src();return false;" href="#;" >Recommencer</a>
<SCRIPT LANGUAGE="JavaScript">
<!--
partie_zoom = document.getElementById("partie_zoom") ;
partie_text = document.getElementById("text")
//-->
</SCRIPT>
</body>
</html> |
Partager