X
X
xlo2402021-08-19 15:14:10
AJAX
xlo240, 2021-08-19 15:14:10

Why doesn't ajax work in FireFox MODX?

In Chrome it returns values, but in Mozilla it doesn't.
611e4aa170cac639344127.png
Processor Multiplies field values ​​and outputs them back with Ajax.

$('#xloform button').on('click', function(evt){
       evt.preventDefault();
        var first = Number($('#first_zn').attr('value'));
       var second = Number($('#second_zn').attr('value'));
       console.log(first, second);
        
        $.ajax({
           type: "POST",
           cache: false,
           url: "ajax1",
           data: "first="+first+"&second="+second+"",
           success: function(msg){
             console.log( "Данные успешно сохранены: " + msg );
             msg = msg.replace(/<\/?[a-zA-Z]+>/gi,'');
             $('#res').text(msg);
           }
        });//ajax
    });//click
});

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Lunegov, 2021-08-20
@alelunegov

Because your request to the address modx2.my-tamagochi.ru/ajax1 returns a response with a 404 error. And not only in Firefox, I also checked with Yandex.Browser, Edge and Chrome - the same thing.

I
Igor, 2021-08-26
@ig0r74

Perhaps this page is not published, but in chrome you are authorized in the admin panel?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question