Guest User

Untitled

a guest
Feb 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <script>
  2. function showUser(str) {
  3. if (str == "") {
  4. document.getElementById("txtHint").innerHTML = "";
  5. return;
  6. } else {
  7. if (window.XMLHttpRequest) {
  8. // code for IE7+, Firefox, Chrome, Opera, Safari
  9. xmlhttp = new XMLHttpRequest();
  10. } else {
  11. // code for IE6, IE5
  12. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  13. }
  14. xmlhttp.onreadystatechange = function() {
  15. if (this.readyState == 4 && this.status == 200) {
  16. var myObj = JSON.parse(this.responseText);
  17. var horas = document.getElementsByClassName("hora");
  18. var i, x, bandeira = 0;
  19. for (x in myObj) {
  20. for (i = 0; i < horas.length; i++) {
  21. if (horas[i].value == myObj[x]) {
  22.  
  23. horas[i].disabled = true;
  24. bandeira++;
  25. break;
  26. } else {
  27. horas[i].disabled = false;
  28. }
  29. }
  30. }
  31.  
  32. //alert(this.responseText);
  33. }
  34. };
  35. xmlhttp.open("GET", "verificar_marcacao.php?q=" + str, true);
  36. xmlhttp.send();
  37. }
  38. }
  39.  
  40. </script>
Add Comment
Please, Sign In to add comment