Answer the question
In order to leave comments, you need to log in
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);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question