1
0

maybe working

This commit is contained in:
dtb 2022-02-20 13:29:02 -05:00
parent 178f2c4958
commit 4b040fa5fa

View File

@ -8,6 +8,7 @@
/* firefox doesn't support import assertions yet (2022-02-20; fx 97.0) */
window.quotes = [ ["Couldn't get quotes array.", "quotes.js"] ];
window.QUOTES_FILE_LOCATION = "/js/quotes.json";
window.QUOTES_L_QUOTE_MARK = '"';
window.QUOTES_R_QUOTE_MARK = '"';
window.QUOTES_QUOTE_AUTHOR_ID = "quote_author";
@ -15,7 +16,7 @@ window.QUOTES_QUOTE_AUTHOR_PREFIX = "~ ";
window.QUOTES_QUOTE_VALUE_ID = "quote_value";
window.quotes_initialize = function(){
fetch("./quotes.json").then(response => {return response.json();}).then(data => console.log(data));
fetch(window.QUOTES_FILE_LOCATION).then(response => {return response.json();}).then(data => window.quotes = data["quotes"]);
};
/* Will not give you the same quote twice in a row! */