Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement for script injecting #364

Open
tomasznetcentric opened this issue Jul 20, 2023 · 0 comments
Open

Improvement for script injecting #364

tomasznetcentric opened this issue Jul 20, 2023 · 0 comments
Labels

Comments

@tomasznetcentric
Copy link
Collaborator

tomasznetcentric commented Jul 20, 2023

In our code base we have several approaches how we include and add JavaScripts in the head.

To avoid duplicate code and improve maintainability, we should limit ourselves to one function injectScript() inside of delayed.js. f.e.

The best way to find all the different approaches is to search for the following terms:

  • head.append(script)
  • head.appendChild(script)
  • document.createElement('script')
  • ...

When centralising the approach we should also align on a default for the script attributes like crossorigin, async etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant