From 72266f462e58b7df99d2b08440c09e28e17ada2e Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Wed, 21 Dec 2022 16:07:14 +0100 Subject: [PATCH] Update README with vanilla and alpine JS. --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index c39b7e9..701be0f 100644 --- a/README.md +++ b/README.md @@ -700,8 +700,24 @@ Includes tracking code for Matomo or Google in a way that supports Content secur To add AlpineJS, jQuery or Umbrella JS, set the related parameter to true in the configuration file or in the front matter of specific pages. No problem having them loaded on the same page. +Personally I use vanilla JS nowadays and I'm playing around with AlpineJS. + This is the way I construct my JavaScript files. +**Vanilla JS:** + +```js +(function () { + + 'use strict'; + + // Add a js class to the html-tag when JavsScript is active. + document.querySelector('html').classList.replace('nojs', 'js'); + +})(); +``` + + **Umbrella JS:** ```js