Skip to content
This repository was archived by the owner on Dec 6, 2022. It is now read-only.
This repository was archived by the owner on Dec 6, 2022. It is now read-only.

Simplify FHP.js and use code supporting modern browsers #350

@Weredime

Description

@Weredime

We currently implement the fetch standard, which is present starting Chromium 42 and Firefox 39.
In FHP.js, we can really simplify it a LOT, and use better code practices supported in these versions, such as:

  • document.createElement instead of Element.innerHTML - XSS could be a thing, but moderation is implemented in the main website. Really, you should just use .innerText, It's supported in most browsers.
  • Use const or let instead of var. The declaration var isn't really good (search it up on google, there are loads of things).
  • Use for .... of .... iterators instead of for (j = 0; j < .... iterators. It's supported in most browsers, and we really don't need the index of the member in the array.
  • We shouldn't keep calling document.getElementById(string) every single time we need to update it in the same section of the code. We should just declare a variable!

I hope you take this into consideration, as this would introduce new JavaScript programmers to better solutions for code, instead of old ones.

Metadata

Metadata

Assignees

Labels

status: needs-triagetype: dev-facingIssues/PRs that have to do with changes to the code that don't actually impact the site

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions