The script below only works if I do not put the absolute path, only the relative path. Can you make it work with absolute path?
Absolute:
xmlhttp.open("GET", "http://servidor.com.br/codec/azul/getcarteira_virutal.php?"+id , true);
Relative:
xmlhttp.open("GET", "getcarteira_virutal.php?"+id , true);
The complete code:
<script>
var url = window.location.search.replace("?", "");
var items = url.split("&");
var array = {
'id' : items[0],
}
var id = array.id;
var obj, dbParam, xmlhttp;
obj = { "table":"customers", "limit":10 };
dbParam = JSON.stringify(obj);
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xmlhttp.open("GET", "http://servidor.com.br/codec/azul/getcarteira_virutal.php?"+id , true);
xmlhttp.send();
</script>