v0.0.7 Try to get ajax to work with backend

This commit is contained in:
Victor
2021-06-04 11:13:38 +02:00
parent 4024c0dd99
commit c7fa37a3ae
4 changed files with 39 additions and 17 deletions
+26
View File
@@ -0,0 +1,26 @@
$("#submit").click(function(){
var $title = $("#title");
var $description = $("#description");
var data = {
title: $title.val(),
description: $description.val(),
};
console.log(data);
$.ajax({
url: '../Backend/controller/upload.php',
type: 'POST',
data: data,
contentType: 'application/json; charset=utf-8',
success: function () {
console.log("Dansker bingo")
},
error: function () {
console.log("error");
}
});
});
+2 -2
View File
@@ -4,10 +4,10 @@ function deletePost(id) {
url: '../Backend/controller/deletePost.php',
data: {'delete_id':id},
success:function (data) {
console.log(data);
console.log("Delete was a success");
},
error:function (data) {
console.log(data);
console.log("Delete was not a success");
}
});
}