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
|
function recup()
{
var ipvoip1 ;
var xhr_object = null ;
xhr_object = new ActiveXObject("Microsoft.XMLHTTP") ;
xhr_object.open("POST", "http://mon site.com", true);
xhr_object.onreadystatechange = function()
{
if(xhr_object.readyState == 4)
{
gauche = xhr_object.responseText;
if (gauche)
{
pos1 = gauche.indexOf("IP CLIENT2</td>") ;
if (pos1 != -1)
{
pos1 = gauche.indexOf(" >",pos1) ;
pos2 = gauche.indexOf("</td>",pos1) ;
ipvoip1 = gauche.substring(pos1+2,pos2) ;
}
else
{
}
document.getElementById('ip2').value=ip2;
}
}
xhr_object.send(null);
}
} |
Partager