Answer the question
In order to leave comments, you need to log in
How to do ajax when switching to https?
Colleagues, the site was transferred to https. ajax stopped working. Tried it in different ways. Maybe I'm doing something wrong in the code itself?
$.ajax({
type: 'POST',
url: ' https://myhost.ru/includes/ajax-php/add_to_cart.php ',
data: {id_product: id, session_id: session, count: count_product, region: region, params_product: params2},
success: function(data) {
var res = JSON.parse(data);
alert(res.count);
}
});
Answer the question
In order to leave comments, you need to log in
Colleagues, the issue has been resolved. I stepped myself. I connected jquery via the http link, but it was necessary via https: https://code.jquery.com/jquery-2.2.4.min.js
Due to the mixing of protocols on the site, jquery did not work.
Thank you all for your sympathy.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question