I hereby claim:
- I am greg-raven on github.
- I am gregraven (https://keybase.io/gregraven) on keybase.
- I have a public key ASBbQizbj8pLP6_BHUHv3DmF17LQdQQjU7wXX9WtXifrTQo
To claim this, I am signing this object:
| /* | |
| * Replicates the functionality of jQuery's `load` function, | |
| * used to load some HTML from another file into the current one. | |
| * | |
| * My version of this Stack Overflow answer: | |
| * https://stackoverflow.com/a/38132775/3626537 | |
| * And `fetch` documentation: | |
| * https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch | |
| * | |
| * @param {string} parentElementId - The ID of the DOM element to load into |
| function addClass(elements, myClass) { | |
| // if there are no elements, we're done | |
| if (!elements) { | |
| return; | |
| } | |
| // if we have a selector, get the chosen elements | |
| if (typeof elements === "string") { | |
| elements = document.querySelectorAll(elements); | |
| } |
I hereby claim:
To claim this, I am signing this object: