Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function req( request, user, password, carriera, callback){
- var url = "http://esse3unica.azurewebsites.net/index.php";
- var params = "request=" + request +"&user=" + user +"&password=" + password +"&carriera=" + carriera;
- var http = new XMLHttpRequest();
- http.open("POST", url, true);
- //Send the proper header information along with the request
- http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- http.onreadystatechange = function() {//Call a function when the state changes.
- if(http.readyState == 4 && http.status == 200) {
- callback(JSON.parse(http.response));
- //alert(http.responseText);
- }
- }
- http.send(params);
- } //req
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement