Why I am getting no data through JQuery?
Hi,
I am using below code to get list of birthdays. I have one birthday in my database on 23/9 and I am able to see it when I check the URL:
but getting nothing when I check this URL:
The only difference between both is (
populate_birthday_GET):
- $day = $_GET["day"];
- $month = $_GET["month"];
and (
populate_birthday):
- $day = $_POST["day"];
- $month = $_POST["month"];
Here is my code:
- var formData = new FormData();
- var current_date = new Date();
- // formData.append("day", current_date.getDate() + 1);
- // formData.append("month", current_date.getMonth());
- formData.append("day", 23);
- formData.append("month", 9);
- $.ajax({
- type: "POST",
- url: "https://www.softnames.com/the_blessed_tree/ws/populate_birthday.php",
- data: formData,
- async: true,
- dataType: "json",
- processData: false,
- beforeSend: function (data) {
- // viewModel.loadPanelVisible(true);
- },
- success: function (data) {
- table = data.Birthday;
- console.log(data);
- },
- error: function () {
- return;
- });
- }
- });