maybe working
This commit is contained in:
parent
178f2c4958
commit
4b040fa5fa
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
/* firefox doesn't support import assertions yet (2022-02-20; fx 97.0) */
|
/* firefox doesn't support import assertions yet (2022-02-20; fx 97.0) */
|
||||||
window.quotes = [ ["Couldn't get quotes array.", "quotes.js"] ];
|
window.quotes = [ ["Couldn't get quotes array.", "quotes.js"] ];
|
||||||
|
window.QUOTES_FILE_LOCATION = "/js/quotes.json";
|
||||||
window.QUOTES_L_QUOTE_MARK = '"';
|
window.QUOTES_L_QUOTE_MARK = '"';
|
||||||
window.QUOTES_R_QUOTE_MARK = '"';
|
window.QUOTES_R_QUOTE_MARK = '"';
|
||||||
window.QUOTES_QUOTE_AUTHOR_ID = "quote_author";
|
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_QUOTE_VALUE_ID = "quote_value";
|
||||||
|
|
||||||
window.quotes_initialize = function(){
|
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! */
|
/* Will not give you the same quote twice in a row! */
|
||||||
|
Loading…
Reference in New Issue
Block a user