Traditional form simulation click submitted successfully, but Ajax reported cross-domain error

< H1 > Preface < / H1 >

the login page for filling in the information is local and made by myself; the authenticated page is not mine, on an uncontrollable server

< H1 > traditional form submission < / H1 >

main.html

$.ajax({
    type: "POST",
    url: "url",
    data:$("-sharpform1").serialize(),
    success: function (res) {
        alert("success!");
    }
});

looking at the console with Google browser will report an error, indicating cross-domain, authentication failed
invalid ps:jsonp

< H1 > php+curl submission < / H1 >

if you send a packet with login information and forged referer field in POST mode through php"s curl, you can authenticate successfully

< H1 > question < / H1 >

is also in js, why can you directly simulate the click of the submit button to submit the form, but not in the way of ajax?
is it just because of cross-domain? So this local login page is also different from the domain, but the simulation button can be submitted? Google Baidu does not understand on the Internet, ask for high people to click to discern!

Mar.07,2021
Menu