Session with absolute path

Asked

Viewed 64 times

1

The script below only works if I nay put the absolute path, only the relative one. It has how to 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>
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.