A
A
Alex_8x2021-06-09 16:07:51
AJAX
Alex_8x, 2021-06-09 16:07:51

Why doesn't sending data from the form to Ajax work in the Instagram browser?

Hello. There is such a project https://maria-psy.ru/robot-copy/index.html . To start a session, you need to fill out the form. Sending data is implemented using Ajax. Here is the piece of code that is responsible for this

$(function(Subscribe) {
  $('.uni-form').submit(function(e) {
    var $form = $(this);
    $.ajax({
      type: $form.attr('method'),
      url: $form.attr('action'),
      data: $form.serialize()
    }).success(function(){
      console.log('success');
      setCookie('subscribed', 'true', 365, false);
      $('.popup').removeClass('d-flex').addClass('d-none');
      startConsultation();
    }).fail(function() {
      console.log('fail');
    });
    //отмена действия по умолчанию для кнопки submit
    e.preventDefault(); 
  });
  console.log(document.cookie);
});


It works fine in all browsers, except for the built-in Instagram browser. Tell me, please, what's wrong?
And how to understand what is happening in this browser. Is there an insta browser tool like Chrome DevTools?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question