F
F
fsgdoterr2021-12-22 20:52:05
AJAX
fsgdoterr, 2021-12-22 20:52:05

Why are ajax requests not sent on the phone?

Designed the site - 8.dev-kit.ru

Everything works fine on the PC, sends ajax requests, processes using php, everything is as it should be, but if you access it from the phone, it gives an error 400, although everything is fine on the PC, as it is maybe at all?

here is the request code

$('.btn-modal').click(()=> {

        const name = $('input[name=name]').val();
        const email = $('input[name=email]');
        const checkbox = $('input[name=trueorfalse]');
        const emailVal = $(email).val();
        const str = 'action=impact&name=' + name + '&email=' + emailVal;
        if(!validateEmail(emailVal)) {
            return false;
        } else if(!$(checkbox).is(':checked')) {
            return false;
        } else {
            $.ajax({
                url: admin_url,
                type: 'post',
                data: str,
                success: (data) => {
                    successEmail();
                },
            });
        }
        return false;
    });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sasmoney, 2021-12-23
@sasmoney

clear cache

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question