How to organize scripts
Anton Ioffe - November 24th 2021 - 1 minutes read
Scripts are small HTML code-snippets that you can iinsert on pages into one of the places:
- inside the head tag
- after opening the body tag
- before closing the body tag
Some scripts can unique per page, while some can be reused on all or some pages.
A script is raw HTML code - meaning you need to take care of script, style and other tags inside.
Use scripts for:
- meta tags
- tracking scripts
- dependencies loading
- global styling (not really recommended, but you can)
Meta tags likely will be unique per URL. Other types of scripts likely will be shared across URLs.