Norman's Note 諾曼筆記

Norman's Note 諾曼筆記

Web API

The Dangers of Stopping Event Propagation

https://css-tricks.com/dangers-stopping-event-propagation/

TextEncoder

https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder

(new TextEncoder().encode('foo')).length

Optional Chaining ?.

https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Operators/Optional_chaining

筆記

  • 如果一個 div 擋在 link 前面,即便 div 是透明的,還是按不到那個 link

  • 用 JavaScript 得到 URL 的 Query String (location.search)

// 假設 "?q=1234"
let urlParams = new URLSearchParams(window.location.search);
console.log(urlParams.get('q')); // "1234"

Used 使用過

To Learn

  • intersection observer API
  • session storage
    在頁面關掉後, session storage 內容也隨之清除