Home Ajax POST Failing Every Time
Reply: 0

Ajax POST Failing Every Time

BadAtEverything
1#
BadAtEverything Published in 2017-12-07 22:07:07Z

I have tried multiple ways of sending a post, such as a XMLHttpRequest. All of them ended in the post failing.
I am using XAMPP to run the webpage this is for.

JS

var obj = {
        title: $("form input[name=title]").val(),
        desc: $("form input[name=desc]").val(),
        etc...
    };
$.post("newpost.php", {data: JSON.stringify(obj)}, function(response){
    console.log("Response: "+response);
}).fail(function(result){
    console.log("Fail "+result);
});  

PHP

echo $_POST["data"];
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.324674 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO