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
| <!DOCTYPE html>
<html>
<head>
<SCRIPT >
function Message() {
}
function maFonctionAjax(unParametre)
{
var MonAjax;
if (window.XMLHttpRequest) {
MonAjax = new XMLHttpRequest(); }
else if (window.ActiveXObject) {
MonAjax = new ActiveXObject('Microsoft.XMLHTTP'); }
else {
alert("Votre navigateur n'est pas adapté pour faire des requêtes AJAX...");
MonAjax = false; }
MonAjax.open('GET',"http://192.168.0.10/command/"+unParametre,true,"admin","admin");
MonAjax.send(null);
}
</script>
</head>
<body>
<div id="myDiv"><h2>PUSH BUTTON</h2></div>
<button type="button" onclick="maFonctionAjax('on')">ON</button>
<button type="button" onclick="maFonctionAjax('off')">OFF</button>
</body>
</html> |
Partager