displays the user's top songs via spotify api, authentication via oauth 2.
This commit is contained in:
+21
-6
@@ -1,10 +1,25 @@
|
||||
async function modeSwitch() {
|
||||
async function modeSwitch(mode) {
|
||||
const content = document.getElementById("content");
|
||||
var response = await fetch('explore.php');
|
||||
console.log(mode);
|
||||
if (mode == 'explore') {
|
||||
var response = await fetch('explore.php');
|
||||
|
||||
if (response.status === 200) {
|
||||
let data = async () => { return await response.text() };
|
||||
let text = await data();
|
||||
content.innerHTML = text;
|
||||
if (response.status === 200) {
|
||||
let data = async () => { return await response.text() };
|
||||
let text = await data();
|
||||
content.innerHTML = text;
|
||||
}
|
||||
switcher.setAttribute("onclick", "modeSwitch('core')")
|
||||
switcher.innerText = 'Core';
|
||||
} else {
|
||||
var response = await fetch('core.php');
|
||||
|
||||
if (response.status === 200) {
|
||||
let data = async () => { return await response.text() };
|
||||
let text = await data();
|
||||
content.innerHTML = text;
|
||||
}
|
||||
switcher.setAttribute("onclick", "modeSwitch('explore')")
|
||||
switcher.innerText = 'Explore';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user