Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. function connection_ajax(){
  2. var hr = new XMLHttpRequest();
  3. var url = "../login/connection.php";
  4. var login = document.getElementById("login").value;
  5. var password = document.getElementById("password").value;
  6. var checkbox = 1;
  7. var vars = "login="+login+"&password="+password;
  8.  
  9. hr.open("POST", url, true);
  10. hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  11. hr.onreadystatechange = function() {
  12. if (hr.readyState == 4 && hr.status == 200) {
  13. var return_data = hr.responseText;
  14. document.getElementById("connectionState").innerHTML = return_data;
  15. }
  16. };
  17. hr.send(vars);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement