-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
33 lines (24 loc) · 913 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
document.getElementById("anniversary").max = new Date().getFullYear()-1;
document.getElementById("anniversary").min = new Date().getFullYear()-60;
$("#findGift").click(function(event){
event.preventDefault();
$('.alert').hide();
if($("#anniversary").val() !="")
{
var a = $("#anniversary").val();
var b = new Date().getFullYear();
var calc = b-a;
$.get("scraper.php?anniversary="+$("#anniversary").val(),function(data){
if(data=="")
{
$("#theYear").hide();
$("#fail").fadeIn();
} else{
$("#theYear").html("<h2><i class='fas fa-calendar-alt'></i> "+calc+"</h2>").fadeIn();
$("#success").html("<h2><span><i class='fas fa-gift'></i></span> "+data+"</h2>").fadeIn();
}
});
} else{
$("#noGift").fadeIn();
}
});