Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z ukrywaniem elementów
Giekuss
post 18.05.2015, 22:04:35
Post #1





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 4.05.2012

Ostrzeżenie: (0%)
-----


PILNE!

Mam taki skrypt:

  1. <script type="text/javascript">
  2. //rezerwacje.html?checkRoomStatus=check&day=8&month=5&year=2015&roomId=6
  3. function getSearchParameters() {
  4. var prmstr = window.location.search.substr(1);
  5. return prmstr != null && prmstr != "" ? transformToAssocArray(prmstr) : {};
  6. }
  7.  
  8. function transformToAssocArray( prmstr ) {
  9. var params = {};
  10. var prmarr = prmstr.split("&");
  11. for ( var i = 0; i < prmarr.length; i++) {
  12. var tmparr = prmarr[i].split("=");
  13. params[tmparr[0]] = tmparr[1];
  14. }
  15. return params;
  16. }
  17.  
  18. var params = getSearchParameters();
  19.  
  20. var ddl = document.getElementById('roomId');
  21. function CheckAndModify(id)
  22. {
  23. var xmlhttp=new XMLHttpRequest();
  24. xmlhttp.onreadystatechange=function() {
  25. if (xmlhttp.readyState===4 && xmlhttp.status===200) {
  26. //alert(xmlhttp.responseText);
  27. if (xmlhttp.responseText == "true")
  28. {
  29. ddl.options[id].style ="display: none;";
  30. ddl.remove(id);
  31. }
  32. }
  33. }
  34. //alert("rezerwacje.html?checkRoomStatus=check&day="+params['day']+"&month="+params['month']+"&year="+params['year']+"&roomId="+ddl.options[id].value);
  35. xmlhttp.open("GET","rezerwacje.html?checkRoomStatus=check&day="+params['day']+"&month="+params['month']+"&year="+params['year']+"&roomId="+ddl.options[id].value,true);
  36. xmlhttp.send();
  37. }
  38. for (i = 0; i < ddl.options.length; i++) {
  39. //alert("found:"+ddl.options[i].value);
  40. CheckAndModify(i);
  41. }


Nie chce mi ukrywać wszystkich zarezerwowanych elementów sad.gif
Błagam o pomoc
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.04.2024 - 16:50