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.

Screen Shot 2021-11-26 at 0.01.27

Don't Get Left Behind:
The Top 5 Career-Ending Mistakes Software Developers Make
FREE Cheat Sheet for Software Developers