From 113e7f369f252e5a9d39f6373a26f14f576716a1 Mon Sep 17 00:00:00 2001 From: scott Date: Thu, 9 May 2024 22:23:49 +0000 Subject: [PATCH] Delete javascript_notes.txt --- javascript_notes.txt | 45 -------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 javascript_notes.txt diff --git a/javascript_notes.txt b/javascript_notes.txt deleted file mode 100644 index bd8f8c7..0000000 --- a/javascript_notes.txt +++ /dev/null @@ -1,45 +0,0 @@ -keywords to research: - -1. async -2. await -3. fetch -4. Promise.all -5. resolve() -6. Blob() - needed to download files. Creation of a blob is needed to link the data to a download link to trigger a download see -the sample javascript below. -7. new - I think this is a constructor? -8. appendChild -9. createElement -10. removeChild -11. window.URL.createObjectURL -12. click -13. window - - - - -// Create a Blob containing the file data -var fileData = "Hello, this is the content of the file!"; -var blob = new Blob([fileData], { type: "text/plain" }); - -// Create an anchor element and set its attributes -var a = document.createElement("a"); -a.href = window.URL.createObjectURL(blob); // Create a URL for the Blob -a.download = "example.txt"; - -// Append the anchor element to the body -document.body.appendChild(a); - -// Programmatically click the anchor to trigger the download -a.click(); - -// Remove the anchor from the body -document.body.removeChild(a); - - -* may have to concatenate the games with newlines prior to making the blob. DEFINITELY HAVE TO -Keep in mind that if the number of games is large, and you're dealing with a substantial amount of data, you might want to consider optimizing the concatenation process to avoid performance issues. Depending on your use case, you could use an array to store the individual games and then use the join method to concatenate them with a separator. - --- you will have to piece the app together - -UPDATE: since your site is static and your client essentially has to download the entire website to their machine first it means that requests are not coming from a different origin. This means you don't need jsonp or cors. So you can write your application without the necessary complications