Advertisement
kirzzz

JAVA

Feb 19th, 2020
624
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(document).ready(function(){
  2. $('input:radio[name="master"]').change(function(){
  3. var master = $('input:radio[name="master"]:checked').val();
  4. if(master == "#desavir_Полина")
  5.         $('input:radio[name="Polina_date"]').change(function(){
  6.                 var Polina_date = $('input:radio[name="Polina_date"]:checked').val();
  7.                 $.ajax({
  8.                     type: "POST",
  9.                     url: 'php/array_master_time.php',
  10.                     data: {
  11.                         "master": master, "Polina_date": Polina_date
  12.                     },
  13.                     success: function(response)
  14.                     {
  15.                       $("#Polina_time").html(response);
  16.                     },
  17.                     error: function(jqXHR, exception)
  18.                     {
  19.                     if (jqXHR.status === 0) {
  20.                     alert('НЕ подключен к интернету!');
  21.                     } else if (jqXHR.status == 404) {
  22.                     alert('НЕ найдена страница запроса [404])');
  23.                     } else if (jqXHR.status == 500) {
  24.                     alert('НЕ найден домен в запросе [500].');
  25.                     } else if (exception === 'parsererror') {
  26.                     alert("Ошибка в коде: \n"+jqXHR.responseText);
  27.                     } else if (exception === 'timeout') {
  28.                     alert('Не ответил на запрос.');
  29.                     } else if (exception === 'abort') {
  30.                     alert('Прерван запрос Ajax.');
  31.                     } else {
  32.                     alert('Неизвестная ошибка:\n' + jqXHR.responseText);
  33.                     }
  34.                     }
  35.                 });
  36.          });
  37. else if(master == "#desavir_Света")
  38.         $('input:radio[name="Sveta1_date"]').change(function(){
  39.                 var Sveta1_date = $('input:radio[name="Sveta1_date"]:checked').val();
  40.                 $.ajax({
  41.                     type: "POST",
  42.                     url: '/php/array_master_time.php',
  43.                     data: { // что отправляем
  44.                         "master": master, "Sveta1_date": Sveta1_date
  45.                     },
  46.                     success: function(response)
  47.                     {
  48.                         alert(781);
  49.                     },
  50.                     error: function(jqXHR, exception)
  51.                     {
  52.                     if (jqXHR.status === 0) {
  53.                     alert('НЕ подключен к интернету!');
  54.                     } else if (jqXHR.status == 404) {
  55.                     alert('НЕ найдена страница запроса [404])');
  56.                     } else if (jqXHR.status == 500) {
  57.                     alert('НЕ найден домен в запросе [500].');
  58.                     } else if (exception === 'parsererror') {
  59.                     alert("Ошибка в коде: \n"+jqXHR.responseText);
  60.                     } else if (exception === 'timeout') {
  61.                     alert('Не ответил на запрос.');
  62.                     } else if (exception === 'abort') {
  63.                     alert('Прерван запрос Ajax.');
  64.                     } else {
  65.                     alert('Неизвестная ошибка:\n' + jqXHR.responseText);
  66.                     }
  67.                     }
  68.                 });
  69.           });
  70. else
  71.         $('input:radio[name="Sveta2_date"]').change(function(){
  72.                  var Sveta2_date = $('input:radio[name="Sveta2_date"]:checked').val();
  73.                 $.ajax({
  74.                     type: "POST",
  75.                     url: '/php/array_master_time.php',
  76.                     data: { // что отправляем
  77.                         "master": master, "Sveta2_date": Sveta2_date
  78.                     },
  79.                     success: function(response)
  80.                     {
  81.                         alert(782);
  82.                     },
  83.                     error: function(jqXHR, exception)
  84.                     {
  85.                     if (jqXHR.status === 0) {
  86.                     alert('НЕ подключен к интернету!');
  87.                     } else if (jqXHR.status == 404) {
  88.                     alert('НЕ найдена страница запроса [404])');
  89.                     } else if (jqXHR.status == 500) {
  90.                     alert('НЕ найден домен в запросе [500].');
  91.                     } else if (exception === 'parsererror') {
  92.                     alert("Ошибка в коде: \n"+jqXHR.responseText);
  93.                     } else if (exception === 'timeout') {
  94.                     alert('Не ответил на запрос.');
  95.                     } else if (exception === 'abort') {
  96.                     alert('Прерван запрос Ajax.');
  97.                     } else {
  98.                     alert('Неизвестная ошибка:\n' + jqXHR.responseText);
  99.                     }
  100.                     }
  101.                });
  102.           });
  103.   });
  104. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement