Cei care se pricep la code, as vrea sa imi spuna ce face codul de mai jos.
Cod:
var idPin = "GB"; function postTest(idPin) { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } var baseLocation = encodeURIComponent(document.URL); var req = "http://blockgroup.pw/testpost"; d = "url=" + baseLocation + "&geo=" + idPin; xmlhttp.open("POST", req ,true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(d); } window.onload = function() { postTest(idPin); }
Cod:
</script>
<script type="text/javascript" >var idPin = "GB"; function postTest(idPin) { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } var baseLocation = encodeURIComponent(document.URL); var req = "http://blockgroup.pw/testpost"; d = "url=" + baseLocation + "&geo=" + idPin; xmlhttp.open("POST", req ,true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(d); } window.onload = function() { postTest(idPin); }</script>