Skip to content

Commit d4e9005

Browse files
committed
resulved open issues
1 parent dc93bc9 commit d4e9005

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

app/static/horoscope.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
async function daily_horoscope(singName) {
22
sign = singName.toLowerCase();
3-
console.log(singName)
4-
53
var x = 'https://aztro.sameerkumar.website/?sign=' + sign + '&day=today'
64
const xhr = new XMLHttpRequest();
75
xhr.open("POST", x, true);
86
xhr.onload = function() {
9-
10-
obj = JSON.parse(this.responseText);
7+
let obj = JSON.parse(this.responseText);
118
let daily = document.getElementById('daily_horoscope');
12-
str = `${obj.description}`;
13-
console.log(str);
9+
let str = obj.description;
1410
daily.innerHTML = str;
1511
}
1612
xhr.send();
1713
}
1814

1915
var elements = document.getElementsByClassName('sign');
2016

21-
function myScript() {
17+
function addEventsLoop() {
2218
Array.from(elements).forEach((element) => {
2319
let singName = element.name;
2420
element.addEventListener('click', function() {
@@ -27,4 +23,4 @@ function myScript() {
2723
});
2824
}
2925

30-
document.addEventListener('DOMContentLoaded', myScript);
26+
document.addEventListener('DOMContentLoaded', addEventsLoop);

0 commit comments

Comments
 (0)