A
A
Asikov Artur2018-09-17 15:18:22
css
Asikov Artur, 2018-09-17 15:18:22

How to fix problem in Safari (IOS 9.3.5 - ipad 2, iphone 4)?

When you click on the sub_wrapper block, the list block opens.

$('.list').hide();

function char_db(sub, char){			//выдаем разделы
  if( (sub == 1) || (sub == 2) || (sub == 3) ) {
    sub = Number.parseInt(sub);	
    $.ajax({ 
          type: "POST",
          url: "/char",
          data: {asub : sub},
          success:function (resp) {
            let text = JSON.parse(resp);
            for(i = 0; i < text.length; i++){
              $('.charter_i').find('ul').append('<li data="'+ text[i]['id'] + '">' + (i+1) + '. ' + text[i]['names'] +'</li>');
            }
            show_charter(char);	
          }
        }).fail(function () {
          return;
        });
  } else {
    return;	
  }
}

$('.sub_wrapper').on("click", function(){		//обрабатываем клик 
    if (!($('.list.charter_i').hasClass('visi'))) { 	//если не показаны разделы
      let char = $(this);
      let sub = $(this).attr('data');
      char_db(sub, char);	
      } else {
        if ($(this).find('span').hasClass('detected')) {return}
        hide_charter();
      };
    });

Tested with iPad 2, iPhone 4 does not work. Everything works great on the iPhone 8. How to find an error, tell me? Everything is ok in the console. I checked adaptability on a computer browser - everything is also ok (for tf, for a tablet)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Chefranov, 2018-09-17
@Artur937

Try like this:

$('.list').hide();

function char_db(sub, char) {
  //выдаем разделы
  if (sub == 1 || sub == 2 || sub == 3) {
    sub = Number.parseInt(sub);
    $.ajax({
      type: "POST",
      url: "/char",
      data: { asub: sub },
      success: function success(resp) {
        var text = JSON.parse(resp);
        for (i = 0; i < text.length; i++) {
          $('.charter_i').find('ul').append('<li data="' + text[i]['id'] + '">' + (i + 1) + '. ' + text[i]['names'] + '</li>');
        }
        show_charter(char);
      }
    }).fail(function () {
      return;
    });
  } else {
    return;
  }
}

$('.sub_wrapper').on("click", function () {
  //обрабатываем клик 
  if (!$('.list.charter_i').hasClass('visi')) {
    //если не показаны разделы
    var char = $(this);
    var sub = $(this).attr('data');
    char_db(sub, char);
  } else {
    if ($(this).find('span').hasClass('detected')) {
      return;
    }
    hide_charter();
  };
});

There's an old iOS with an old Safari and it probably doesn't support ES 6

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question