You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that you're writing pure vanilla JS, but as a learning exercise it would be good to try to do both of the following
Separate out some functionality into other vanilla JS files and make some more composable "modules" that way
Look into learning about some JavaScript build system like Webpack that will take multiple JS files and build them into one minified "bundle"
Security Discussion
In your app you use innerHTML = <div>... to set some HTML from your JavaScript
This current implementation is not vulnerable at all because you do not use any data that you got from a user when generating this HTML
If you are interested in trying to generate HTML using user input, make sure you use a framework like React, some sort of templating engine, or a XSS prevention library like DOMPurify
DOMPurify is how you would handle this if you were still using fully vanilla JS
(Overall it might be easiest to just try to avoid altering your HTML in your JS when working with vanilla JS if you need user input)
The text was updated successfully, but these errors were encountered:
General Code Structure
Security Discussion
innerHTML = <div>...
to set some HTML from your JavaScriptThe text was updated successfully, but these errors were encountered: