function createPost(title, desc) { var data = { title: title, description: desc, }; $.ajax({ url: '../Backend/controller/upload.php', type: 'POST', data: data, success: function (data) { console.log(data) }, error: function () { console.log("error"); } }); }